mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
Fix space-before-function-paren linter rule
This commit is contained in:
@@ -5,10 +5,10 @@ var plugins = require('../../plugins');
|
||||
|
||||
var pluginsController = {};
|
||||
|
||||
pluginsController.get = function(req, res, next) {
|
||||
pluginsController.get = function (req, res, next) {
|
||||
async.parallel({
|
||||
compatible: function(next) {
|
||||
plugins.list(function(err, plugins) {
|
||||
compatible: function (next) {
|
||||
plugins.list(function (err, plugins) {
|
||||
if (err || !Array.isArray(plugins)) {
|
||||
plugins = [];
|
||||
}
|
||||
@@ -16,8 +16,8 @@ pluginsController.get = function(req, res, next) {
|
||||
next(null, plugins);
|
||||
});
|
||||
},
|
||||
all: function(next) {
|
||||
plugins.list(false, function(err, plugins) {
|
||||
all: function (next) {
|
||||
plugins.list(false, function (err, plugins) {
|
||||
if (err || !Array.isArray(plugins)) {
|
||||
plugins = [];
|
||||
}
|
||||
@@ -25,28 +25,28 @@ pluginsController.get = function(req, res, next) {
|
||||
next(null, plugins);
|
||||
});
|
||||
}
|
||||
}, function(err, payload) {
|
||||
}, function (err, payload) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
var compatiblePkgNames = payload.compatible.map(function(pkgData) {
|
||||
var compatiblePkgNames = payload.compatible.map(function (pkgData) {
|
||||
return pkgData.name;
|
||||
});
|
||||
|
||||
res.render('admin/extend/plugins' , {
|
||||
installed: payload.compatible.filter(function(plugin) {
|
||||
installed: payload.compatible.filter(function (plugin) {
|
||||
return plugin.installed;
|
||||
}),
|
||||
upgradeCount: payload.compatible.reduce(function(count, current) {
|
||||
upgradeCount: payload.compatible.reduce(function (count, current) {
|
||||
if (current.installed && current.outdated) {
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}, 0),
|
||||
download: payload.compatible.filter(function(plugin) {
|
||||
download: payload.compatible.filter(function (plugin) {
|
||||
return !plugin.installed;
|
||||
}),
|
||||
incompatible: payload.all.filter(function(plugin) {
|
||||
incompatible: payload.all.filter(function (plugin) {
|
||||
return compatiblePkgNames.indexOf(plugin.name) === -1;
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user