mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-02 12:01:53 +08:00
Chore: update ESLint config
This commit is contained in:
@@ -181,10 +181,10 @@ function matchWithRegExpArray(input, regexps = []) {
|
||||
}
|
||||
|
||||
function escapeRegExp(string = '') {
|
||||
const reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
||||
const reRegExpChar = /[$()*+.?[\\\]^{|}]/g;
|
||||
const reHasRegExpChar = RegExp(reRegExpChar.source);
|
||||
|
||||
return string && reHasRegExpChar.test(string)
|
||||
? string.replace(reRegExpChar, '\\$&')
|
||||
? string.replaceAll(reRegExpChar, '\\$&')
|
||||
: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user