mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Use _.difference instead of _.without.apply(_, …) in test and build files.
Former-commit-id: 5646e8c3e895ea0662df81e7c77e70cdfe2c3a6d
This commit is contained in:
22
build.js
22
build.js
@@ -383,10 +383,10 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** List of Lo-Dash methods */
|
/** List of Lo-Dash methods */
|
||||||
var lodashMethods = _.without.apply(_, [allMethods, 'findWhere'].concat(privateMethods));
|
var lodashMethods = _.difference(allMethods, privateMethods.concat('findWhere'));
|
||||||
|
|
||||||
/** List of Underscore methods */
|
/** List of Underscore methods */
|
||||||
var underscoreMethods = _.without.apply(_, [allMethods].concat(lodashOnlyMethods, privateMethods));
|
var underscoreMethods = _.difference(allMethods, lodashOnlyMethods.concat(privateMethods));
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@@ -1109,7 +1109,7 @@
|
|||||||
result.push(varA || varB || varC);
|
result.push(varA || varB || varC);
|
||||||
});
|
});
|
||||||
|
|
||||||
return _.without.apply(_, [_.uniq(result)].concat(lodashMethods)).sort();
|
return _.difference(_.uniq(result), allMethods).sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2098,10 +2098,10 @@
|
|||||||
|
|
||||||
var isLodashMethod = function(methodName) {
|
var isLodashMethod = function(methodName) {
|
||||||
if (_.contains(lodashOnlyMethods, methodName) || /^(?:assign|zipObject)$/.test(methodName)) {
|
if (_.contains(lodashOnlyMethods, methodName) || /^(?:assign|zipObject)$/.test(methodName)) {
|
||||||
var methods = _.without.apply(_, [_.union(includeMethods, plusMethods)].concat(minusMethods));
|
var methods = _.difference(_.union(includeMethods, plusMethods), minusMethods);
|
||||||
return _.contains(methods, methodName);
|
return _.contains(methods, methodName);
|
||||||
}
|
}
|
||||||
methods = _.without.apply(_, [plusMethods].concat(minusMethods));
|
methods = _.difference(plusMethods, minusMethods);
|
||||||
return _.contains(methods, methodName);
|
return _.contains(methods, methodName);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2160,9 +2160,9 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// remove categories from method names
|
// remove categories from method names
|
||||||
includeMethods = _.without.apply(_, [includeMethods].concat(methodCategories));
|
includeMethods = _.difference(includeMethods, methodCategories);
|
||||||
minusMethods = _.without.apply(_, [minusMethods].concat(methodCategories));
|
minusMethods = _.difference(minusMethods, methodCategories);
|
||||||
plusMethods = _.without.apply(_, [plusMethods].concat(methodCategories));
|
plusMethods = _.difference(plusMethods, methodCategories);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@@ -2439,10 +2439,10 @@
|
|||||||
result = _.union(result, plusMethods);
|
result = _.union(result, plusMethods);
|
||||||
}
|
}
|
||||||
if (minusMethods.length) {
|
if (minusMethods.length) {
|
||||||
result = _.without.apply(_, [result].concat(minusMethods, isNoDep
|
result = _.difference(result, isNoDep
|
||||||
? minusMethods
|
? minusMethods
|
||||||
: getDependants(minusMethods)
|
: minusMethods.concat(getDependants(minusMethods))
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
if (!isNoDep) {
|
if (!isNoDep) {
|
||||||
result = getDependencies(result);
|
result = getDependencies(result);
|
||||||
|
|||||||
@@ -322,7 +322,7 @@
|
|||||||
var lodashMethods = allMethods.slice();
|
var lodashMethods = allMethods.slice();
|
||||||
|
|
||||||
/** List of Underscore methods */
|
/** List of Underscore methods */
|
||||||
var underscoreMethods = _.without.apply(_, [allMethods].concat(lodashOnlyMethods));
|
var underscoreMethods = _.difference(allMethods, lodashOnlyMethods);
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@@ -1660,10 +1660,10 @@
|
|||||||
methodNames = methodNames.concat(command.match(/\bplus=(\S*)/)[1].split(/, */));
|
methodNames = methodNames.concat(command.match(/\bplus=(\S*)/)[1].split(/, */));
|
||||||
}
|
}
|
||||||
if (/\bminus=/.test(command)) {
|
if (/\bminus=/.test(command)) {
|
||||||
methodNames = _.without.apply(_, [methodNames].concat(expandMethodNames(command.match(/\bminus=(\S*)/)[1].split(/, */))));
|
methodNames = _.difference(methodNames, expandMethodNames(command.match(/\bminus=(\S*)/)[1].split(/, */)));
|
||||||
}
|
}
|
||||||
if (/\bexclude=/.test(command)) {
|
if (/\bexclude=/.test(command)) {
|
||||||
methodNames = _.without.apply(_, [methodNames].concat(expandMethodNames(command.match(/\bexclude=(\S*)/)[1].split(/, */))));
|
methodNames = _.difference(methodNames, expandMethodNames(command.match(/\bexclude=(\S*)/)[1].split(/, */)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// expand categories to real method names
|
// expand categories to real method names
|
||||||
|
|||||||
@@ -3697,7 +3697,7 @@
|
|||||||
return /^_/.test(methodName);
|
return /^_/.test(methodName);
|
||||||
});
|
});
|
||||||
|
|
||||||
var funcs = _.without.apply(_, [allMethods].concat([
|
var funcs = _.difference(allMethods, [
|
||||||
'after',
|
'after',
|
||||||
'bind',
|
'bind',
|
||||||
'bindAll',
|
'bindAll',
|
||||||
@@ -3713,7 +3713,7 @@
|
|||||||
'tap',
|
'tap',
|
||||||
'throttle',
|
'throttle',
|
||||||
'wrap'
|
'wrap'
|
||||||
]));
|
]);
|
||||||
|
|
||||||
_.each(funcs, function(methodName) {
|
_.each(funcs, function(methodName) {
|
||||||
var actual = [],
|
var actual = [],
|
||||||
|
|||||||
Reference in New Issue
Block a user