You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Object.keys(logic).length===1// with exactly one key
171
174
);
172
175
};
173
176
174
177
/*
175
178
This helper will defer to the JsonLogic spec as a tie-breaker when different language interpreters define different behavior for the truthiness of primitives. E.g., PHP considers empty arrays to be falsy, but Javascript considers them to be truthy. JsonLogic, as an ecosystem, needs one consistent answer.
176
179
177
-
Literal | JS | PHP | JsonLogic
178
-
--------+-------+-------+---------------
179
-
[] | true | false | false
180
-
"0" | true | false | true
180
+
Spec and rationale here: http://jsonlogic.com/truthy
0 commit comments