mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
use includes instead of indexOf
use _.uniq instead of filter&indexOf
This commit is contained in:
@@ -50,7 +50,7 @@ try {
|
||||
checkVersion('commander');
|
||||
checkVersion('colors');
|
||||
} catch (e) {
|
||||
if (['ENOENT', 'DEP_WRONG_VERSION', 'MODULE_NOT_FOUND'].indexOf(e.code) !== -1) {
|
||||
if (['ENOENT', 'DEP_WRONG_VERSION', 'MODULE_NOT_FOUND'].includes(e.code)) {
|
||||
console.warn('Dependencies outdated or not yet installed.');
|
||||
console.log('Installing them now...\n');
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ function upgradePlugins(callback) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (['y', 'Y', 'yes', 'YES'].indexOf(result.upgrade) !== -1) {
|
||||
if (['y', 'Y', 'yes', 'YES'].includes(result.upgrade)) {
|
||||
console.log('\nUpgrading packages...');
|
||||
var args = packageManagerInstallArgs.concat(found.map(function (suggestObj) {
|
||||
return suggestObj.name + '@' + suggestObj.suggested;
|
||||
|
||||
Reference in New Issue
Block a user