aboutsummaryrefslogtreecommitdiff
path: root/src/shared/utils
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-22 22:17:00 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-10-22 22:17:00 +0900
commitb9f2668ceab3d786ce3e587803ff30ec5c781ee3 (patch)
tree96ae119fb5e7939547284f72fc12cd9cc6c717d5 /src/shared/utils
parentc6eb5553d0477f96b5edd48012b4c4ab342f026c (diff)
add blacklist setting
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 };