mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Move _.remove to the "Arrays" category and add unit tests.
Former-commit-id: b0542496b45582b8ca59de19e950dc2368deee0a
This commit is contained in:
10
build.js
10
build.js
@@ -194,7 +194,7 @@
|
||||
'reduce': ['baseCreateCallback', 'baseEach', 'isArray'],
|
||||
'reduceRight': ['baseCreateCallback', 'forEachRight'],
|
||||
'reject': ['createCallback', 'filter'],
|
||||
'remove': ['baseEach', 'createCallback', 'isArray'],
|
||||
'remove': ['createCallback'],
|
||||
'rest': ['createCallback', 'slice'],
|
||||
'result': ['isFunction'],
|
||||
'runInContext': ['defaults', 'pick'],
|
||||
@@ -338,6 +338,7 @@
|
||||
'lastIndexOf',
|
||||
'pull',
|
||||
'range',
|
||||
'remove',
|
||||
'rest',
|
||||
'sortedIndex',
|
||||
'union',
|
||||
@@ -375,7 +376,6 @@
|
||||
'reduce',
|
||||
'reduceRight',
|
||||
'reject',
|
||||
'remove',
|
||||
'shuffle',
|
||||
'size',
|
||||
'some',
|
||||
@@ -3001,11 +3001,11 @@
|
||||
_.pull(funcDepMap[funcName], 'baseEach').push('forEach');
|
||||
});
|
||||
|
||||
_.each(['contains', 'every', 'filter', 'find', 'forEach', 'map', 'max', 'min', 'reduce', 'remove', 'some'], function(funcName) {
|
||||
_.each(['contains', 'every', 'filter', 'find', 'forEach', 'map', 'max', 'min', 'reduce', 'some'], function(funcName) {
|
||||
_.pull(funcDepMap[funcName], 'baseEach').push('forOwn');
|
||||
});
|
||||
|
||||
_.each(['every', 'find', 'filter', 'forEach', 'forIn', 'forOwn', 'map', 'reduce', 'remove', 'shimKeys'], function(funcName) {
|
||||
_.each(['every', 'find', 'filter', 'forEach', 'forIn', 'forOwn', 'map', 'reduce', 'shimKeys'], function(funcName) {
|
||||
if (!(isUnderscore && isLodash(funcName))) {
|
||||
_.pull(funcDepMap[funcName], 'isArray');
|
||||
}
|
||||
@@ -3260,7 +3260,7 @@
|
||||
].join('\n'));
|
||||
|
||||
// replace `isArray(collection)` checks in "Collections" functions with simpler type checks
|
||||
_.each(['every', 'filter', 'find', 'max', 'min', 'reduce', 'remove', 'some'], function(funcName) {
|
||||
_.each(['every', 'filter', 'find', 'max', 'min', 'reduce', 'some'], function(funcName) {
|
||||
source = source.replace(matchFunction(source, funcName), function(match) {
|
||||
if (funcName == 'reduce') {
|
||||
match = match.replace(/^( *)var noaccum\b/m, '$1if (!collection) return accumulator;\n$&');
|
||||
|
||||
Reference in New Issue
Block a user