Skip to content

undefined facts #215

@calpa

Description

@calpa

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions