From b9f2668ceab3d786ce3e587803ff30ec5c781ee3 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 22 Oct 2017 22:17:00 +0900 Subject: add blacklist setting --- src/shared/utils/re.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/shared/utils/re.js (limited to 'src/shared/utils') 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 }; -- cgit v1.2.3