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,46 +6,46 @@ var async = require('async');
var topics = require('../topics');
var utils = require('../../public/src/utils');
module.exports = function(Posts) {
module.exports = function (Posts) {
Posts.getPostsFromSet = function(set, start, stop, uid, reverse, callback) {
Posts.getPostsFromSet = function (set, start, stop, uid, reverse, callback) {
async.waterfall([
function(next) {
function (next) {
Posts.getPidsFromSet(set, start, stop, reverse, next);
},
function(pids, next) {
function (pids, next) {
Posts.getPostsByPids(pids, uid, next);
}
], callback);
};
Posts.isMain = function(pid, callback) {
Posts.isMain = function (pid, callback) {
async.waterfall([
function(next) {
function (next) {
Posts.getPostField(pid, 'tid', next);
},
function(tid, next) {
function (tid, next) {
topics.getTopicField(tid, 'mainPid', next);
},
function(mainPid, next) {
function (mainPid, next) {
next(null, parseInt(pid, 10) === parseInt(mainPid, 10));
}
], callback);
};
Posts.getTopicFields = function(pid, fields, callback) {
Posts.getTopicFields = function (pid, fields, callback) {
async.waterfall([
function(next) {
function (next) {
Posts.getPostField(pid, 'tid', next);
},
function(tid, next) {
function (tid, next) {
topics.getTopicFields(tid, fields, next);
}
], callback);
};
Posts.generatePostPath = function (pid, uid, callback) {
Posts.generatePostPaths([pid], uid, function(err, paths) {
Posts.generatePostPaths([pid], uid, function (err, paths) {
callback(err, Array.isArray(paths) && paths.length ? paths[0] : null);
});
};
@@ -57,11 +57,11 @@ module.exports = function(Posts) {
},
function (postData, next) {
async.parallel({
indices: function(next) {
indices: function (next) {
Posts.getPostIndices(postData, uid, next);
},
topics: function(next) {
var tids = postData.map(function(post) {
topics: function (next) {
var tids = postData.map(function (post) {
return post ? post.tid : null;
});
@@ -70,7 +70,7 @@ module.exports = function(Posts) {
}, next);
},
function (results, next) {
var paths = pids.map(function(pid, index) {
var paths = pids.map(function (pid, index) {
var slug = results.topics[index] ? results.topics[index].slug : null;
var postIndex = utils.isNumber(results.indices[index]) ? parseInt(results.indices[index], 10) + 1 : null;