소스 검색

fix: conditions RegEx

Ahmad Kholid 2 년 전
부모
커밋
8b8d7b8b4c
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/utils/testConditions.js

+ 2 - 1
src/utils/testConditions.js

@@ -26,7 +26,8 @@ const comparisons = {
   enw: (a, b) => a?.endsWith(b) ?? false,
   rgx: (a, b) => {
     const match = b.match(/^\/(.*?)\/([gimy]*)$/);
-    const regex = new RegExp(match[1], match[2]);
+    const regex = match ? new RegExp(match[1], match[2]) : new RegExp(b);
+
     return regex.test(a);
   },
   itr: (a) => Boolean(isBoolStr(a)),