mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
fix(utils): improve escapeRegExp function
This commit is contained in:
@@ -61,5 +61,5 @@ export function looseToNumber(val: any): any {
|
||||
}
|
||||
|
||||
export function escapeRegExp(string: string) {
|
||||
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
||||
return string.replace(/[.*+?^${}()|[\]\\]/g, match => `\\${match}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user