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

conditionsMeet fails on array of strings #18

Closed
mrclay opened this issue Feb 15, 2018 · 1 comment
Closed

conditionsMeet fails on array of strings #18

mrclay opened this issue Feb 15, 2018 · 1 comment

Comments

@mrclay
Copy link
Contributor

mrclay commented Feb 15, 2018

If the form data is an array, conditionsMeet first tries to see if any elements in the array pass the condition:

https://github.com/RxNT/json-rules-engine-simplified/blob/c271482533324b275341e0598f24bc8c9667c23d/src/conditionsMeet.js#L38-L40

But this means a string gets passed as val to conditionsMeet, which it can't handle.

I think the inner function handling refVal.some() should just return false if val isn't an object rather than letting conditionsMeet throw.

mrclay added a commit to mrclay/json-rules-engine-simplified that referenced this issue Feb 15, 2018
conditionsMeet can handle testing values that are arrays of strings.
However it still fails to test arrays of numbers.
@mrclay
Copy link
Contributor Author

mrclay commented Feb 15, 2018

PR #19

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