aboutsummaryrefslogtreecommitdiff
path: root/src/shared/utils
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-23 10:43:33 +0000
committerGitHub <noreply@github.com>2017-10-23 10:43:33 +0000
commitccc81312a1d4d9a5cea7d7451c26ec25b2172aa8 (patch)
tree96ae119fb5e7939547284f72fc12cd9cc6c717d5 /src/shared/utils
parent7639e99b755e372712dca36e077a85d9a025cd9f (diff)
parentb9f2668ceab3d786ce3e587803ff30ec5c781ee3 (diff)
Merge pull request #90 from ueokande/11-url-blacklist
URL blacklist
Diffstat (limited to 'src/shared/utils')
-rw-r--r--src/shared/utils/re.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/shared/utils/re.js b/src/shared/utils/re.js
new file mode 100644
index 0000000..7db9091
--- /dev/null
+++ b/src/shared/utils/re.js
@@ -0,0 +1,6 @@
+const fromWildcard = (pattern) => {
+ let regexStr = '^' + pattern.replace(/\*/g, '.*') + '$';
+ return new RegExp(regexStr);
+};
+
+export { fromWildcard };