Remove alternative _.where for Underscore build.

Former-commit-id: 4e42a26d4c16157957fa43dbb31ae9706e2641b8
This commit is contained in:
John-David Dalton
2012-11-12 07:35:33 -08:00
parent d29b8eca3c
commit d873890e46
3 changed files with 3 additions and 28 deletions

View File

@@ -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) {',