Fix space-before-function-paren linter rule

This commit is contained in:
HeeL
2016-10-13 11:43:39 +02:00
parent 3fa1c1f927
commit 4a3c31b2dc
385 changed files with 6621 additions and 6622 deletions

View File

@@ -8,14 +8,14 @@ var topics = require('../topics');
var groups = require('../groups');
var privileges = require('../privileges');
module.exports = function(Categories) {
module.exports = function (Categories) {
Categories.purge = function(cid, uid, callback) {
batch.processSortedSet('cid:' + cid + ':tids', function(tids, next) {
async.eachLimit(tids, 10, function(tid, next) {
Categories.purge = function (cid, uid, callback) {
batch.processSortedSet('cid:' + cid + ':tids', function (tids, next) {
async.eachLimit(tids, 10, function (tid, next) {
topics.purgePostsAndTopic(tid, uid, next);
}, next);
}, {alwaysStartAt: 0}, function(err) {
}, {alwaysStartAt: 0}, function (err) {
if (err) {
return callback(err);
}
@@ -28,13 +28,13 @@ module.exports = function(Categories) {
function purgeCategory(cid, callback) {
async.series([
function(next) {
function (next) {
db.sortedSetRemove('categories:cid', cid, next);
},
function(next) {
function (next) {
removeFromParent(cid, next);
},
function(next) {
function (next) {
db.deleteAll([
'cid:' + cid + ':tids',
'cid:' + cid + ':tids:posts',
@@ -45,8 +45,8 @@ module.exports = function(Categories) {
'category:' + cid
], next);
},
function(next) {
async.each(privileges.privilegeList, function(privilege, next) {
function (next) {
async.each(privileges.privilegeList, function (privilege, next) {
groups.destroy('cid:' + cid + ':privileges:' + privilege, next);
}, next);
}
@@ -55,29 +55,29 @@ module.exports = function(Categories) {
function removeFromParent(cid, callback) {
async.waterfall([
function(next) {
function (next) {
async.parallel({
parentCid: function(next) {
parentCid: function (next) {
Categories.getCategoryField(cid, 'parentCid', next);
},
children: function(next) {
children: function (next) {
db.getSortedSetRange('cid:' + cid + ':children', 0, -1, next);
}
}, next);
},
function(results, next) {
function (results, next) {
async.parallel([
function(next) {
function (next) {
results.parentCid = parseInt(results.parentCid, 10) || 0;
db.sortedSetRemove('cid:' + results.parentCid + ':children', cid, next);
},
function(next) {
async.each(results.children, function(cid, next) {
function (next) {
async.each(results.children, function (cid, next) {
async.parallel([
function(next) {
function (next) {
db.setObjectField('category:' + cid, 'parentCid', 0, next);
},
function(next) {
function (next) {
db.sortedSetAdd('cid:0:children', cid, cid, next);
}
], next);
@@ -85,7 +85,7 @@ module.exports = function(Categories) {
}
], next);
}
], function(err) {
], function (err) {
callback(err);
});
}