mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Remove semicolons.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import toString from './toString.js';
|
||||
import toString from './toString.js'
|
||||
|
||||
/**
|
||||
* Used to match `RegExp`
|
||||
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
||||
*/
|
||||
const reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
||||
const reHasRegExpChar = RegExp(reRegExpChar.source);
|
||||
const reRegExpChar = /[\\^$.*+?()[\]{}|]/g
|
||||
const reHasRegExpChar = RegExp(reRegExpChar.source)
|
||||
|
||||
/**
|
||||
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
|
||||
@@ -18,14 +18,14 @@ const reHasRegExpChar = RegExp(reRegExpChar.source);
|
||||
* @see escape, escapeRegExp, unescape
|
||||
* @example
|
||||
*
|
||||
* escapeRegExp('[lodash](https://lodash.com/)');
|
||||
* escapeRegExp('[lodash](https://lodash.com/)')
|
||||
* // => '\[lodash\]\(https://lodash\.com/\)'
|
||||
*/
|
||||
function escapeRegExp(string) {
|
||||
string = toString(string);
|
||||
string = toString(string)
|
||||
return (string && reHasRegExpChar.test(string))
|
||||
? string.replace(reRegExpChar, '\\$&')
|
||||
: string;
|
||||
: string
|
||||
}
|
||||
|
||||
export default escapeRegExp;
|
||||
export default escapeRegExp
|
||||
|
||||
Reference in New Issue
Block a user