feat: allow strip filter with specified char, closes #390

This commit is contained in:
Harttle
2022-03-06 00:20:51 +08:00
parent 01014edc49
commit c503cb23df
3 changed files with 33 additions and 10 deletions
+4
View File
@@ -156,3 +156,7 @@ export function caseInsensitiveCompare (a: any, b: any) {
export function argumentsToValue<F extends (...args: any) => any> (fn: F) {
return (...args: Parameters<F>) => fn(...args.map(toValue))
}
export function escapeRegExp (text: string) {
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
}