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

@@ -6,9 +6,9 @@ var db = require('../database');
var topics = require('../topics');
var plugins = require('../plugins');
module.exports = function(Categories) {
module.exports = function (Categories) {
Categories.getCategoryTopics = function(data, callback) {
Categories.getCategoryTopics = function (data, callback) {
async.waterfall([
function (next) {
plugins.fireHook('filter:category.topics.prepare', data, next);
@@ -36,12 +36,12 @@ module.exports = function(Categories) {
], callback);
};
Categories.modifyTopicsByPrivilege = function(topics, privileges) {
Categories.modifyTopicsByPrivilege = function (topics, privileges) {
if (!Array.isArray(topics) || !topics.length || privileges.isAdminOrMod) {
return;
}
topics.forEach(function(topic) {
topics.forEach(function (topic) {
if (topic.deleted && !topic.isOwner) {
topic.title = '[[topic:topic_is_deleted]]';
topic.slug = topic.tid;
@@ -52,7 +52,7 @@ module.exports = function(Categories) {
});
};
Categories.getTopicIds = function(set, reverse, start, stop, callback) {
Categories.getTopicIds = function (set, reverse, start, stop, callback) {
if (Array.isArray(set)) {
db[reverse ? 'getSortedSetRevIntersect' : 'getSortedSetIntersect']({sets: set, start: start, stop: stop}, callback);
} else {
@@ -60,8 +60,8 @@ module.exports = function(Categories) {
}
};
Categories.getTopicIndex = function(tid, callback) {
topics.getTopicField(tid, 'cid', function(err, cid) {
Categories.getTopicIndex = function (tid, callback) {
topics.getTopicField(tid, 'cid', function (err, cid) {
if (err) {
return callback(err);
}
@@ -70,29 +70,29 @@ module.exports = function(Categories) {
});
};
Categories.onNewPostMade = function(cid, pinned, postData, callback) {
Categories.onNewPostMade = function (cid, pinned, postData, callback) {
if (!cid || !postData) {
return callback();
}
async.parallel([
function(next) {
function (next) {
db.sortedSetAdd('cid:' + cid + ':pids', postData.timestamp, postData.pid, next);
},
function(next) {
function (next) {
db.incrObjectField('category:' + cid, 'post_count', next);
},
function(next) {
function (next) {
if (parseInt(pinned, 10) === 1) {
next();
} else {
db.sortedSetAdd('cid:' + cid + ':tids', postData.timestamp, postData.tid, next);
}
},
function(next){
function (next){
Categories.updateRecentTid(cid, postData.tid, next);
},
function(next) {
function (next) {
db.sortedSetIncrBy('cid:' + cid + ':tids:posts', 1, postData.tid, next);
}
], callback);