Skip to main content

is_js_truthy

Function is_js_truthy 

Source
pub fn is_js_truthy(value: &ParseValue) -> bool
Expand description

JavaScript truthiness, which is what !classPermissions[operation] tests.

The trap is Array: an empty array is truthy in JavaScript, and empty-is-falsy is the reflex a Rust reader brings. Everything with a __type envelope is an object on the JS side and therefore truthy too, including empty Bytes.

Public because it is not a CLP concern in particular. Any port of an upstream if (value) or !value needs it, and re-deriving the rule per call site is how the Array trap gets missed.