mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Cleanup build.js regexes.
Former-commit-id: 0d23053cd8ae20fa2268ba24b15db72c6cd7a85e
This commit is contained in:
10
build.js
10
build.js
@@ -1060,7 +1060,7 @@
|
||||
// replace `_.clone`
|
||||
if (useUnderscoreClone) {
|
||||
dependencyMap.clone = ['extend', 'isArray'];
|
||||
source = source.replace(/( +)function clone[\s\S]+?\n\1}/, [
|
||||
source = source.replace(/^( +)function clone[\s\S]+?\n\1}/m, [
|
||||
' function clone(value) {',
|
||||
' return value && objectTypes[typeof value]',
|
||||
' ? (isArray(value) ? slice.call(value) : extend({}, value))',
|
||||
@@ -1070,7 +1070,7 @@
|
||||
}
|
||||
|
||||
// replace `_.difference`
|
||||
source = source.replace(/( +)function difference[\s\S]+?\n\1}/, [
|
||||
source = source.replace(/^( +)function difference[\s\S]+?\n\1}/m, [
|
||||
' function difference(array) {',
|
||||
' var index = -1,',
|
||||
' length = array.length,',
|
||||
@@ -1088,7 +1088,7 @@
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.intersection`
|
||||
source = source.replace(/( +)function intersection[\s\S]+?\n\1}/, [
|
||||
source = source.replace(/^( +)function intersection[\s\S]+?\n\1}/m, [
|
||||
' function intersection(array) {',
|
||||
' var argsLength = arguments.length,',
|
||||
' index = -1,',
|
||||
@@ -1111,7 +1111,7 @@
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.without`
|
||||
source = source.replace(/( +)function without[\s\S]+?\n\1}/, [
|
||||
source = source.replace(/^( +)function without[\s\S]+?\n\1}/m, [
|
||||
' function without(array) {',
|
||||
' var index = -1,',
|
||||
' length = array.length,',
|
||||
@@ -1236,6 +1236,8 @@
|
||||
source = removeFromCreateIterator(source, 'nativeKeys');
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
if (isMobile) {
|
||||
// inline all functions defined with `createIterator`
|
||||
_.functions(lodash).forEach(function(methodName) {
|
||||
|
||||
Reference in New Issue
Block a user