Skip to content

Commit 14971cc

Browse files
committed
Cleaning up from linting
1 parent e12bc96 commit 14971cc

File tree

8 files changed

+44
-76
lines changed

8 files changed

+44
-76
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"es6": true
99
},
1010
"rules": {
11-
"no-underscore-dangle": "off"
11+
"no-underscore-dangle": "off",
12+
"no-continue": "off"
1213
}
1314
}

controllers/ping.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
}
3737

3838
router.post('/', urlencodedParser, function (req, res) {
39-
const params = parsePingParams(req);
40-
const result = ping(params.url)
41-
.then(result => processResponse(req, res, result))
42-
.catch(err => handleError(req, res, err));
39+
const params = parsePingParams(req),
40+
result = ping(params.url)
41+
.then(result => processResponse(req, res, result))
42+
.catch(err => handleError(req, res, err));
4343
});
4444

4545
module.exports = router;

controllers/please-notify.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(function () {
22
"use strict";
33

4-
var bodyParser = require('body-parser'),
4+
const bodyParser = require('body-parser'),
55
errorResult = require('../services/error-result'),
66
express = require('express'),
77
parseNotifyParams = require('../services/parse-notify-params'),
@@ -34,14 +34,14 @@
3434
}
3535

3636
router.post('/', urlencodedParser, function (req, res) {
37-
const params = parseNotifyParams(req);
38-
const result = pleaseNotify(
39-
params.apiurl,
40-
params.urlList,
41-
params.diffDomain
42-
)
43-
.then(result => processResponse(req, res, result))
44-
.catch(err => handleError(req, res, err));
37+
const params = parseNotifyParams(req),
38+
result = pleaseNotify(
39+
params.apiurl,
40+
params.urlList,
41+
params.diffDomain
42+
)
43+
.then(result => processResponse(req, res, result))
44+
.catch(err => handleError(req, res, err));
4545
});
4646

4747
module.exports = router;

migrations/20170530180056-add-log-events.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

services/init-resource.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@
66

77
async function initResource(resourceUrl) {
88
const resource = await mongodb.get()
9-
.collection('resources')
10-
.findOne({
11-
_id: resourceUrl
12-
});
13-
14-
const defaultResource = {
15-
_id: resourceUrl,
16-
flDirty: true,
17-
lastSize: 0,
18-
lastHash: '',
19-
ctChecks: 0,
20-
whenLastCheck: moment.utc('0', 'x').format(),
21-
ctUpdates: 0,
22-
whenLastUpdate: moment.utc('0', 'x').format()
23-
};
9+
.collection('resources')
10+
.findOne({
11+
_id: resourceUrl
12+
}),
13+
defaultResource = {
14+
_id: resourceUrl,
15+
flDirty: true,
16+
lastSize: 0,
17+
lastHash: '',
18+
ctChecks: 0,
19+
whenLastCheck: moment.utc('0', 'x').format(),
20+
ctUpdates: 0,
21+
whenLastUpdate: moment.utc('0', 'x').format()
22+
};
2423

2524
return Object.assign({}, defaultResource, resourceUrl || {});
2625
}

services/mongodb.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
};
99

1010
module.exports = {
11-
connect: async function(uri) {
11+
connect: async function (uri) {
1212
if (state.db) {
1313
return;
1414
}
@@ -53,10 +53,10 @@
5353
return client.db();
5454
});
5555
},
56-
get: function() {
56+
get: function () {
5757
return state.db;
5858
},
59-
close: async function() {
59+
close: async function () {
6060
if (state.db) {
6161
return state.db.close()
6262
.then(() => {
@@ -65,4 +65,4 @@
6565
}
6666
}
6767
};
68-
}());
68+
}());

services/notify-one-challenge.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
testUrl = apiurl + '?' + querystring.stringify({
1111
'url': resourceUrl,
1212
'challenge': challenge
13+
}),
14+
res = await request({
15+
uri: testUrl,
16+
resolveWithFullResponse: true
1317
});
1418

15-
const res = await request({
16-
uri: testUrl,
17-
resolveWithFullResponse: true
18-
});
19-
2019
if (res.statusCode < 200 || res.statusCode > 299 || res.body !== challenge) {
2120
throw new Error('Notification Failed');
2221
}

services/notify-one.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
async function notifyOne(resourceUrl, apiurl) {
77
const res = await request({
8-
method: 'POST',
9-
uri: apiurl,
10-
data: {
11-
'url': resourceUrl
12-
},
13-
resolveWithFullResponse: true
14-
});
8+
method: 'POST',
9+
uri: apiurl,
10+
data: {
11+
'url': resourceUrl
12+
},
13+
resolveWithFullResponse: true
14+
});
1515

1616
if (res.statusCode < 200 || res.statusCode > 299) {
1717
throw new Error('Notification Failed');

0 commit comments

Comments
 (0)