Chore: update ESLint config

This commit is contained in:
SukkaW
2023-09-28 22:59:19 +08:00
parent d69def0024
commit 3d2afa608c
21 changed files with 315 additions and 315 deletions

View File

@@ -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;
}