Forráskód Böngészése

fix: conditions RegEx

Ahmad Kholid 2 éve
szülő
commit
8b8d7b8b4c
1 módosított fájl, 2 hozzáadás és 1 törlés
  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)),