Skip to content

Conversation

@cammellos
Copy link
Collaborator

As part of removing some code from the dragon frontend, to be able to use it in our SDK/API, I had to move some frontend logic to the backend.
To do that, I need to use reduce, in order to calculate the length on a array. This is in theory supported by json-logic-js.
The issue is that we run validation against the data provided, but we don't accommodate for the fact that if we are within a reduce/map block, we should allow current and accumulator.
This code enriches the validation data if we are within a reduce/map block, while it maintains checking the integrity of the rest of the variables.

Let me know if the implementation is what you expect or you'd rather be different, thank you!

@cammellos cammellos merged commit 8226857 into remoteoss:main Aug 25, 2025
3 checks passed
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.

3 participants