adobe / json-formula

Query language for JSON documents
http://opensource.adobe.com/json-formula/
Apache License 2.0
19 stars 8 forks source link

Incorrect "notNull" behavior for false-like value #132

Closed Eswcvlad closed 7 months ago

Eswcvlad commented 7 months ago

Somewhat unexpected results...

Expression Result
notNull("", "A")|null
notNull(`false`, "A")|null

Cannot really use this shorthand for notNull, as false || null will be null. https://github.com/adobe/json-formula/blob/8b880fb45586a6967db7365aae132c3cc889643f/src/functions.js#L1154