diff options
| author | eric sciple <ericsciple@users.noreply.github.com> | 2020-03-05 14:21:59 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-05 14:21:59 -0500 |
| commit | 7ca5766bfacc6c307d7e69645aa94ac44318af46 (patch) | |
| tree | 6cf0884441af3df11112f769de7e2bd6b2db727e /src/regexp-helper.ts | |
| parent | 05e00fbe0759a9339f189796ba5ceb3c4c78a556 (diff) | |
add support for submodules (#173)
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}` + }) +} |
