diff options
Diffstat (limited to 'src/regexp-helper.ts')
| -rw-r--r-- | src/regexp-helper.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/regexp-helper.ts b/src/regexp-helper.ts new file mode 100644 index 0000000..ec76c3a --- /dev/null +++ b/src/regexp-helper.ts @@ -0,0 +1,5 @@ +export function escape(value: string): string { + return value.replace(/[^a-zA-Z0-9_]/g, x => { + return `\\${x}` + }) +} |
