mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Remove more unnecessary brackets from template strings during the build process.
Former-commit-id: c8e3dfe7d34f9c61fff75512fb4587a987bdf49f
This commit is contained in:
13
build.js
13
build.js
@@ -819,14 +819,13 @@
|
|||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// simplify template snippets
|
// simplify template snippets by removing unnecessary brackets
|
||||||
source = source.replace(
|
source = source.replace(
|
||||||
RegExp(
|
RegExp("{(\\\\n' *\\+\\s*.*?\\+\\n\\s*')}(?:\\\\n)?' *([,\\n])", 'g'), "$1'$2"
|
||||||
"'else if \\(thisArg\\) \\{\\\\n' \\+\\s*" +
|
);
|
||||||
"' callback = iteratorBind\\(callback, thisArg\\)\\\\n' \\+\\s*" +
|
|
||||||
"'}'"
|
source = source.replace(
|
||||||
, 'g'),
|
RegExp("{(\\\\n' *\\+\\s*.*?\\+\\n\\s*')}(?:\\\\n)?' *\\+", 'g'), "$1;\\n'+"
|
||||||
"'else if (thisArg) callback = iteratorBind(callback, thisArg)'"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|||||||
Reference in New Issue
Block a user