Skip to content

Commit 173baa0

Browse files
committed
remove padding
1 parent 007482d commit 173baa0

11 files changed

Lines changed: 13 additions & 28 deletions

File tree

bin/ldnode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function bin (argv) {
129129
var app
130130
try {
131131
app = ldnode.createServer(argv)
132-
} catch(e) {
132+
} catch (e) {
133133
console.log(e.message)
134134
console.log(e.stack)
135135
return 1

examples/custom-error-handling.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ ldnode
2424
message: err.message
2525
})
2626
}
27-
2827
}
2928
})
3029
.listen(3456, function () {

lib/acl.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ ACL.prototype.can = function (user, mode, resource, callback, options) {
7373
accessType, // accessTo or defaultForNew
7474
acl, // The current Acl file!
7575
function (err) {
76-
return next(!err || err)
77-
}, options)
76+
return next(!err || err)
77+
}, options)
7878
})
7979
},
8080
function (err) {
@@ -220,7 +220,6 @@ ACL.prototype.matchAccessType = function matchAccessType (graph, rule, accessTyp
220220
return matches.some(function (match) {
221221
return S(uri).startsWith(match.object.uri)
222222
})
223-
224223
}
225224

226225
ACL.prototype.matchOrigin = function getOrigins (graph, rule, origin) {
@@ -274,7 +273,7 @@ function fetchDocument (host, ldp, baseUri) {
274273
function (body, cb) {
275274
try {
276275
$rdf.parse(body, graph, uri, 'text/turtle')
277-
} catch(err) {
276+
} catch (err) {
278277
return cb(err, graph)
279278
}
280279
return cb(null, graph)
@@ -291,7 +290,6 @@ function getUserId (req, callback) {
291290

292291
var delegator = rdfVocab.debrack(onBehalfOf)
293292
verifyDelegator(req.hostname, delegator, req.session.userId, function (err, res) {
294-
295293
if (err) {
296294
err.status = 500
297295
return callback(err)
@@ -307,7 +305,6 @@ function getUserId (req, callback) {
307305

308306
function verifyDelegator (host, ldp, baseUri, delegator, delegatee, callback) {
309307
fetchDocument(host, ldp, baseUri)(delegator, function (err, delegatorGraph) {
310-
311308
// TODO handle error
312309
if (err) {
313310
err.status = 500

lib/create-server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ function createServer (argv) {
4242
var key
4343
try {
4444
key = fs.readFileSync(argv.key)
45-
} catch(e) {
45+
} catch (e) {
4646
throw new Error('Can\'t find SSL key in ' + argv.key)
4747
}
4848

4949
var cert
5050
try {
5151
cert = fs.readFileSync(argv.cert)
52-
} catch(e) {
52+
} catch (e) {
5353
throw new Error('Can\'t find SSL cert in ' + argv.cert)
5454
}
5555

lib/handlers/get.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ function get (req, res, next) {
4343

4444
debug(req.method + ' -- Request on:' + req.originalUrl + ' on ' + req.hostname)
4545

46-
ldp.get(req.hostname, req.path, baseUri, includeBody, possibleRDFType,
47-
function (err, stream, contentType, container) {
48-
46+
ldp.get(req.hostname, req.path, baseUri, includeBody, possibleRDFType, function (err, stream, contentType, container) {
4947
// use globHandler if magic is detected
5048
if (err && err.status === 404 && glob.hasMagic(req.path)) {
5149
debug(req.method + ' -- Glob request')
@@ -137,7 +135,7 @@ function globHandler (req, res, next) {
137135
globGraph,
138136
baseUri,
139137
'text/turtle')
140-
} catch(parseErr) {
138+
} catch (parseErr) {
141139
debug('GET -- Error in globHandler' + parseErr)
142140
}
143141
return done(null)

lib/handlers/patch.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function sparql (filename, targetURI, text, callback) {
6464

6565
try {
6666
$rdf.parse(dataIn, targetKB, targetURI, targetContentType)
67-
} catch(e) {
67+
} catch (e) {
6868
debug('Patch: Target ' + targetContentType + ' file syntax error:' + e)
6969
return callback(error(500, 'Patch: Target ' + targetContentType + ' file syntax error:' + e))
7070
}
@@ -79,8 +79,7 @@ function sparql (filename, targetURI, text, callback) {
7979
for (v in bindings) {
8080
if (bindings.hasOwnProperty(v)) {
8181
x = bindings[v]
82-
b[v] = x.uri ? {'type': 'uri', 'value': x.uri} :
83-
{ 'type': 'literal', 'value': x.value }
82+
b[v] = x.uri ? {'type': 'uri', 'value': x.uri} : { 'type': 'literal', 'value': x.value }
8483
if (x.lang) {
8584
b[v]['xml:lang'] = x.lang
8685
}
@@ -123,7 +122,7 @@ function sparqlUpdate (filename, targetURI, text, callback) {
123122
try {
124123
// Must parse relative to document's base address but patch doc should get diff URI
125124
patchObject = $rdf.sparqlUpdateParser(text, patchKB, patchURI)
126-
} catch(e) {
125+
} catch (e) {
127126
return callback(error(400, 'Patch format syntax error:\n' + e + '\n'))
128127
}
129128
debug('PATCH -- reading target file ...')
@@ -137,7 +136,7 @@ function sparqlUpdate (filename, targetURI, text, callback) {
137136

138137
try {
139138
$rdf.parse(dataIn, targetKB, targetURI, targetContentType)
140-
} catch(e) {
139+
} catch (e) {
141140
debug('Patch: Target ' + targetContentType + ' file syntax error:' + e)
142141
return callback(error(500, 'Patch: Target ' + targetContentType + ' file syntax error:' + e))
143142
}

lib/handlers/post.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ function handler (req, res, next) {
1212
// Handle SPARQL(-update?) query
1313
if (contentType === 'application/sparql' ||
1414
contentType === 'application/sparql-update') {
15-
1615
debug('POST -- Handling sparql query via PATCH')
1716
return patch.handler(req, res, next)
1817
}

lib/handlers/proxy.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@ function addProxy (app, path) {
2525
}
2626

2727
debug.settings('Proxy destination URI: ' + uri)
28-
2928
request
3029
.get(uri)
3130
.on('error', function (err) {
3231
var status = err.code === 'ENOTFOUND' ? 404 : 500
3332
res.sendStatus(status)
3433
})
3534
.pipe(res)
36-
3735
})
3836
}

lib/identity-provider.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@ IdentityProvider.prototype.post = function (req, res, next) {
456456
} else {
457457
res.end()
458458
}
459-
460459
})
461460
}
462461

lib/utils.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ function parse (data, baseUri, contentType, callback) {
9393
}
9494

9595
function serialize (graph, baseUri, contentType, callback) {
96-
9796
try {
9897
$rdf.serialize(null, graph, null, contentType, function (err, result) {
9998
if (err) {
@@ -105,13 +104,12 @@ function serialize (graph, baseUri, contentType, callback) {
105104

106105
return callback(null, result)
107106
})
108-
} catch(err) {
107+
} catch (err) {
109108
callback(err)
110109
}
111110
}
112111

113112
function translate (stream, baseUri, from, to, callback) {
114-
115113
// Handle Turtle Accept header
116114
if (to === 'text/turtle' ||
117115
to === 'text/n3' ||

0 commit comments

Comments
 (0)