mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Add fromIndex to _.contains.
Former-commit-id: 9f61db3ceda2d87ddfbfd4cffb2bd1f9732cc79a
This commit is contained in:
15
build.js
15
build.js
@@ -1060,6 +1060,16 @@
|
||||
].join('\n'));
|
||||
}
|
||||
|
||||
// replace `_.contains`
|
||||
source = source.replace(/^( +)function contains[\s\S]+?\n\1}/m, [
|
||||
' function contains(collection, target) {',
|
||||
' var length = collection ? collection.length : 0;',
|
||||
" return typeof length == 'number'",
|
||||
' ? indexOf(collection, target) > -1',
|
||||
' : some(collection, function(value) { return value === target; });',
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.difference`
|
||||
source = source.replace(/^( +)function difference[\s\S]+?\n\1}/m, [
|
||||
' function difference(array) {',
|
||||
@@ -1198,9 +1208,6 @@
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// remove string support from `_.contains`
|
||||
source = source.replace(/return *\(toString\.call.+?stringClass[\s\S]+?;/, 'return indexOf(collection, target) > -1;');
|
||||
|
||||
// remove `arguments` object check from `_.isEqual`
|
||||
source = source.replace(/ *\|\| *className *== *argsClass/, '');
|
||||
|
||||
@@ -1382,7 +1389,7 @@
|
||||
'',
|
||||
' var index = 0,',
|
||||
' source = "__p += \'",',
|
||||
" variable = options.variable;",
|
||||
' variable = options.variable;',
|
||||
'',
|
||||
' var reDelimiters = RegExp(',
|
||||
" (options.escape || reNoMatch).source + '|' +",
|
||||
|
||||
Reference in New Issue
Block a user