mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27: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`
|
// replace `_.clone`
|
||||||
if (useUnderscoreClone) {
|
if (useUnderscoreClone) {
|
||||||
dependencyMap.clone = ['extend', 'isArray'];
|
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) {',
|
' function clone(value) {',
|
||||||
' return value && objectTypes[typeof value]',
|
' return value && objectTypes[typeof value]',
|
||||||
' ? (isArray(value) ? slice.call(value) : extend({}, value))',
|
' ? (isArray(value) ? slice.call(value) : extend({}, value))',
|
||||||
@@ -1070,7 +1070,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// replace `_.difference`
|
// replace `_.difference`
|
||||||
source = source.replace(/( +)function difference[\s\S]+?\n\1}/, [
|
source = source.replace(/^( +)function difference[\s\S]+?\n\1}/m, [
|
||||||
' function difference(array) {',
|
' function difference(array) {',
|
||||||
' var index = -1,',
|
' var index = -1,',
|
||||||
' length = array.length,',
|
' length = array.length,',
|
||||||
@@ -1088,7 +1088,7 @@
|
|||||||
].join('\n'));
|
].join('\n'));
|
||||||
|
|
||||||
// replace `_.intersection`
|
// replace `_.intersection`
|
||||||
source = source.replace(/( +)function intersection[\s\S]+?\n\1}/, [
|
source = source.replace(/^( +)function intersection[\s\S]+?\n\1}/m, [
|
||||||
' function intersection(array) {',
|
' function intersection(array) {',
|
||||||
' var argsLength = arguments.length,',
|
' var argsLength = arguments.length,',
|
||||||
' index = -1,',
|
' index = -1,',
|
||||||
@@ -1111,7 +1111,7 @@
|
|||||||
].join('\n'));
|
].join('\n'));
|
||||||
|
|
||||||
// replace `_.without`
|
// replace `_.without`
|
||||||
source = source.replace(/( +)function without[\s\S]+?\n\1}/, [
|
source = source.replace(/^( +)function without[\s\S]+?\n\1}/m, [
|
||||||
' function without(array) {',
|
' function without(array) {',
|
||||||
' var index = -1,',
|
' var index = -1,',
|
||||||
' length = array.length,',
|
' length = array.length,',
|
||||||
@@ -1236,6 +1236,8 @@
|
|||||||
source = removeFromCreateIterator(source, 'nativeKeys');
|
source = removeFromCreateIterator(source, 'nativeKeys');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------*/
|
||||||
|
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
// inline all functions defined with `createIterator`
|
// inline all functions defined with `createIterator`
|
||||||
_.functions(lodash).forEach(function(methodName) {
|
_.functions(lodash).forEach(function(methodName) {
|
||||||
|
|||||||
Reference in New Issue
Block a user