Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bourgeoa committed Apr 9, 2024
1 parent 8028672 commit 08cded4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/create-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const [acceptEvents, events, eventID, prep] = (awaitSync(Promise.all([
import('express-accept-events'),
import('express-events-negotiate'),
import('express-prep/event-id'),
import('express-prep'),
import('express-prep')
]))).map(lib => lib.default)

const corsSettings = cors({
Expand Down Expand Up @@ -71,7 +71,7 @@ function createApp (argv = {}) {
const app = express()

// Add PREP support
app.use(acceptEvents, events, eventID, prep);
app.use(acceptEvents, events, eventID, prep)

initAppLocals(app, argv, ldp)
initHeaders(app)
Expand Down
12 changes: 6 additions & 6 deletions lib/handlers/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ async function handler (req, res, next) {

if (stream && negotiator.mediaType([contentType])) {
let headers = {
'Content-Type': contentType,
'Content-Type': contentType
}
if (contentRange) {
headers = {
Expand All @@ -133,13 +133,13 @@ async function handler (req, res, next) {
'Accept-Ranges': 'bytes',
'Content-Length': chunksize
}
res.statusCode = 206;
res.statusCode = 206
}

if (isRdf(contentType) && !res.sendEvents({
config: { prep: '' },
body: stream,
headers,
headers
})) return
res.set(headers)
return stream.pipe(res)
Expand All @@ -154,13 +154,13 @@ async function handler (req, res, next) {
// Translate from the contentType found to the possibleRDFType desired
const data = await translate(stream, baseUri, contentType, possibleRDFType)
debug(req.originalUrl + ' translating ' + contentType + ' -> ' + possibleRDFType)
let headers = {
'Content-Type': possibleRDFType,
const headers = {
'Content-Type': possibleRDFType
}
if (isRdf(contentType) && !res.sendEvents({
config: { prep: '' },
body: data,
headers,
headers
})) return
res.setHeader('Content-Type', possibleRDFType)
res.write(data) // res.send(data)
Expand Down
6 changes: 3 additions & 3 deletions lib/handlers/patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const crypto = require('crypto')
const { overQuota, getContentType } = require('../utils')
const withLock = require('../lock')

const { awaitSync } = require('@kaciras/deasync');
const { awaitSync } = require('@kaciras/deasync')
const rfc822Template = awaitSync(import('express-prep/templates')).rfc822

// Patch parsers by request body content type
Expand Down Expand Up @@ -97,8 +97,8 @@ async function patchHandler (req, res, next) {
// Send the result to the client
res.send(result)
res.events.prep.trigger({
generateNotifications: () => `\r\n${rfc822Template({res})}`,
});
generateNotifications: () => `\r\n${rfc822Template({ res })}`
})
} catch (err) {
return next(err)
}
Expand Down

0 comments on commit 08cded4

Please sign in to comment.