mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Make regexp var name singular.
This commit is contained in:
14
lodash.js
14
lodash.js
@@ -117,11 +117,9 @@
|
||||
reIsPlainProp = /^\w*$/,
|
||||
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g;
|
||||
|
||||
/**
|
||||
* Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
|
||||
*/
|
||||
var reRegExpChars = /[\\^$.*+?()[\]{}|]/g,
|
||||
reHasRegExpChars = RegExp(reRegExpChars.source);
|
||||
/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */
|
||||
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
||||
reHasRegExpChar = RegExp(reRegExpChar.source);
|
||||
|
||||
/** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */
|
||||
var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;
|
||||
@@ -1319,7 +1317,7 @@
|
||||
|
||||
/** Used to detect if a method is native. */
|
||||
var reIsNative = RegExp('^' +
|
||||
fnToString.call(hasOwnProperty).replace(reRegExpChars, '\\$&')
|
||||
fnToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
||||
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
||||
);
|
||||
|
||||
@@ -10418,8 +10416,8 @@
|
||||
*/
|
||||
function escapeRegExp(string) {
|
||||
string = baseToString(string);
|
||||
return (string && reHasRegExpChars.test(string))
|
||||
? string.replace(reRegExpChars, '\\$&')
|
||||
return (string && reHasRegExpChar.test(string))
|
||||
? string.replace(reRegExpChar, '\\$&')
|
||||
: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user