The Wayback Machine - https://web.archive.org/web/20200911133624/https://github.com/CacheControl/json-rules-engine/issues/215
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

undefined facts #215

Open
calpa opened this issue Jul 8, 2020 · 1 comment
Open

undefined facts #215

calpa opened this issue Jul 8, 2020 · 1 comment

Comments

@calpa
Copy link

@calpa calpa commented Jul 8, 2020

When the user removed the input value, the value (fact) will becomes undefined.

Which throws an error according to the following code...

if (typeof this.value === 'undefined' && typeof this.calculationMethod === 'undefined') {
  throw new Error('facts must have a value or method')
}

Link: https://github.com/CacheControl/json-rules-engine/blob/master/src/fact.js#L29

One possible solution is to pass allowUndefinedFacts: true to the Fact Class.

Related issues: #111

@saswat3115
Copy link

@saswat3115 saswat3115 commented Jul 8, 2020

even if u pass allowUndefinedFacts: true this also fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.