Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/src/regexp-helper.ts
diff options
context:
space:
mode:
authoreric sciple <ericsciple@users.noreply.github.com>2020-03-05 14:21:59 -0500
committerGitHub <noreply@github.com>2020-03-05 14:21:59 -0500
commit7ca5766bfacc6c307d7e69645aa94ac44318af46 (patch)
tree6cf0884441af3df11112f769de7e2bd6b2db727e /src/regexp-helper.ts
parent05e00fbe0759a9339f189796ba5ceb3c4c78a556 (diff)
add support for submodules (#173)
Diffstat (limited to 'src/regexp-helper.ts')
-rw-r--r--src/regexp-helper.ts5
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}`
+ })
+}