Skip to content

Commit 6ff42ca

Browse files
author
Marco Franceschi
committed
feat: Included matchAll for regex operators
1 parent b22971c commit 6ff42ca

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/rules-engine/operators/regex.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ export default {
1212
return result
1313
}
1414

15+
return false
16+
},
17+
matchAll: (a, b) => {
18+
if (Array.isArray(a)) {
19+
const result = a
20+
.map(value =>
21+
typeof value === 'string' ? !new RegExp(b).test(value) : undefined
22+
)
23+
.every(v => v)
24+
return result
25+
}
26+
1527
return false
1628
},
1729
}

0 commit comments

Comments
 (0)