use includes instead of indexOf

use _.uniq instead of filter&indexOf
This commit is contained in:
Barış Soner Uşaklı
2018-10-20 14:40:48 -04:00
parent a6c70412db
commit 26d4e0852f
57 changed files with 156 additions and 208 deletions

View File

@@ -115,7 +115,7 @@ var basePath = path.resolve(__dirname, '../..');
function minifyModules(modules, fork, callback) {
var moduleDirs = modules.reduce(function (prev, mod) {
var dir = path.resolve(path.dirname(mod.destPath));
if (prev.indexOf(dir) === -1) {
if (!prev.includes(dir)) {
prev.push(dir);
}
return prev;