mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Simplify regexps in build.js.
Former-commit-id: 7640f90b6aeca0438579c15c9eef270904c2c523
This commit is contained in:
6
build.js
6
build.js
@@ -251,9 +251,9 @@
|
|||||||
// match a function declaration
|
// match a function declaration
|
||||||
'( +)function ' + funcName + '\\b[\\s\\S]+?\\n\\1}|' +
|
'( +)function ' + funcName + '\\b[\\s\\S]+?\\n\\1}|' +
|
||||||
// match a variable declaration with `createIterator`
|
// match a variable declaration with `createIterator`
|
||||||
' +var ' + funcName + ' *= *(?:[a-zA-Z]+ *\\|\\| *)?createIterator\\((?:{|[a-zA-Z])[\\s\\S]+?\\);|' +
|
' +var ' + funcName + ' *=.*createIterator\\((?:{|[a-zA-Z])[\\s\\S]+?\\);|' +
|
||||||
// match a variable declaration with function expression
|
// match a variable declaration with function expression
|
||||||
'( +)var ' + funcName + ' *= *(?:[a-zA-Z]+ *\\|\\| *)?function[\\s\\S]+?\\n\\2};' +
|
'( +)var ' + funcName + ' *=.*function[\\s\\S]+?\\n\\2};' +
|
||||||
// end non-capturing group
|
// end non-capturing group
|
||||||
')\\n'
|
')\\n'
|
||||||
));
|
));
|
||||||
@@ -484,7 +484,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// remove pseudo private properties
|
// remove pseudo private properties
|
||||||
source = source.replace(/(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n/g, '\n');
|
source = source.replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n');
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user