generated from shortercode/ts-library-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
JSONata compatibilityCan either capture valid or invalid compatibility issuesCan either capture valid or invalid compatibility issues
Description
Path expressions use an automatic packing/unpacking algorithm in several places. It works on 2 equivalency rules, where any place one would be accepted the other must also. Also when resolving a value the latter is the preferred output.
[ value ] == value
[] == undefinedThis means in some scenarios you will get a value or undefined instead of an array when the input data changes, making the expressions somewhat unpredictable.
I propose we modify this behaviour slightly to make it more predictable. We unfortunately cannot do this everywhere as it breaks some nice to haves.
- path expressions will always resolve to an array.
- field expressions will normally resolve to an array but may also resolve to the value of the only element or undefined.
- wildcard expressions will normally resolve to an array but may also resolve to the value of the only element or undefined.
let output = ({ a: 1 }).a
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
JSONata compatibilityCan either capture valid or invalid compatibility issuesCan either capture valid or invalid compatibility issues