mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 20:07:49 +00:00
Simplify regexp that escapes regexp special characters.
Former-commit-id: dde89b0f7d9cd31768eecd4ef92c0ae9d1b5d581
This commit is contained in:
@@ -47,7 +47,7 @@
|
|||||||
/** Used to detect if a method is native */
|
/** Used to detect if a method is native */
|
||||||
var reNative = RegExp('^' +
|
var reNative = RegExp('^' +
|
||||||
(objectRef.valueOf + '')
|
(objectRef.valueOf + '')
|
||||||
.replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&')
|
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
||||||
.replace(/valueOf|for [^\]]+/g, '.+?') + '$'
|
.replace(/valueOf|for [^\]]+/g, '.+?') + '$'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user