mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Remove alternative _.where for Underscore build.
Former-commit-id: 4e42a26d4c16157957fa43dbb31ae9706e2641b8
This commit is contained in:
21
build.js
21
build.js
@@ -1031,7 +1031,6 @@
|
||||
dependencyMap.min = ['forEach', 'isArray'];
|
||||
dependencyMap.pick = [];
|
||||
dependencyMap.template = ['defaults', 'escape'];
|
||||
dependencyMap.where = ['filter', 'forIn'];
|
||||
|
||||
if (useUnderscoreClone) {
|
||||
dependencyMap.clone = ['assign', 'isArray'];
|
||||
@@ -1292,26 +1291,6 @@
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.where`
|
||||
source = source.replace(/^( *)function where[\s\S]+?\n\1}/m, [
|
||||
' function where(collection, properties) {',
|
||||
' var props = [];',
|
||||
' forIn(properties, function(value, prop) {',
|
||||
' props.push(prop);',
|
||||
' });',
|
||||
' return filter(collection, function(object) {',
|
||||
' var length = props.length;',
|
||||
' while (length--) {',
|
||||
' var result = object[props[length]] === properties[props[length]];',
|
||||
' if (!result) {',
|
||||
' break;',
|
||||
' }',
|
||||
' }',
|
||||
' return !!result;',
|
||||
' });',
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.without`
|
||||
source = source.replace(/^( *)function without[\s\S]+?\n\1}/m, [
|
||||
' function without(array) {',
|
||||
|
||||
Reference in New Issue
Block a user