Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: "matches" predicate is throwing rgx.test is not a function #40

Open
bhaskarkaranam opened this issue May 24, 2023 · 0 comments
Open

Comments

@bhaskarkaranam
Copy link

Matches predicate which helps to do regex check is throwing and rgx.test is not a function.
Rule and whole Engine run I used:

var Engine = require("json-rules-engine-simplified").default
let regexp = new RegExp('g')
console.log(regexp, "regular expression")
let rules = [{
conditions: {
"firstName": {
"matches": regexp
}
},
event: {
"ignore": "fjbehdsj"
}
}];
let input = {"firstName": "ugvdfvgfd"}
let engine = new Engine(rules)
engine.run(input).then((events) => {
console.log("events", events)
})

Error :

TypeError: rgx.test is not a function
in predicate/lib/predicates.js — line 182
at Object.curried (as matches) in predicate/lib/utils.js — line 22
in json-rules-engine-simplified/lib/checkField.js — line 39
at Array.every in ECMAScript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant