Skip to content

Conversation

@horacio-penya
Copy link
Contributor

Rules like:

logic.run({var: 'toString'},{toString: 'hello'}) // expect "hello"
logic.run({var: 'values'},{values: [1,2,3]}) // expect [1,2,3]

return null because "hello".toString is a function, even if we want to get "hello" (a valid object, not a function)

This happens because we're checking for context[key] even when key is already implied in context because we have descended into it during the previous for loop.

@TotalTechGeek
Copy link
Member

Hey, I think I'll merge this, but I might make some touch ups afterwards. I did some additional testing on my side and it appears good.

@TotalTechGeek TotalTechGeek merged commit 219b0d0 into json-logic:master Oct 8, 2024
3 of 4 checks passed
@TotalTechGeek
Copy link
Member

Thanks for the PR @horacio-penya.

I've provided a few other minor tweaks and have pushed a new version of this package out as 1.3.7

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

Successfully merging this pull request may close these issues.

2 participants