mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +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(
|
||||
RegExp(
|
||||
"'else if \\(thisArg\\) \\{\\\\n' \\+\\s*" +
|
||||
"' callback = iteratorBind\\(callback, thisArg\\)\\\\n' \\+\\s*" +
|
||||
"'}'"
|
||||
, 'g'),
|
||||
"'else if (thisArg) callback = iteratorBind(callback, thisArg)'"
|
||||
RegExp("{(\\\\n' *\\+\\s*.*?\\+\\n\\s*')}(?:\\\\n)?' *([,\\n])", 'g'), "$1'$2"
|
||||
);
|
||||
|
||||
source = source.replace(
|
||||
RegExp("{(\\\\n' *\\+\\s*.*?\\+\\n\\s*')}(?:\\\\n)?' *\\+", 'g'), "$1;\\n'+"
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user