mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Ensure _.escapeRegExp handles empty strings in a way to work with compilation.
This commit is contained in:
@@ -10492,7 +10492,7 @@
|
|||||||
string = baseToString(string);
|
string = baseToString(string);
|
||||||
return (string && reHasRegExpChars.test(string))
|
return (string && reHasRegExpChars.test(string))
|
||||||
? string.replace(reRegExpChars, '\\$&')
|
? string.replace(reRegExpChars, '\\$&')
|
||||||
: string;
|
: (string || '(?:)');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user