mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Optimize the ES6 template delimiter regexp and regexp to detect strings.
Former-commit-id: 6177f2b32f27515cf8edcac6036d0adb58ebfcd0
This commit is contained in:
@@ -233,7 +233,7 @@
|
||||
source = source.replace("result[length]['value']", 'result[length].value');
|
||||
|
||||
// remove whitespace from string literals
|
||||
source = source.replace(/^([ "'\w]+:)? *"(?:(?=(\\?))\2.)*?"|'(?:(?=(\\?))\3.)*?'/gm, function(string, captured) {
|
||||
source = source.replace(/^([ "'\w]+:)? *"[^"\\\n]*(?:\\.[^"\\\n]*)*"|'[^'\\\n]*(?:\\.[^'\\\n]*)*'/gm, function(string, captured) {
|
||||
// remove object literal property name
|
||||
if (/:$/.test(captured)) {
|
||||
string = string.slice(captured.length);
|
||||
|
||||
Reference in New Issue
Block a user