Skip to main content

is_truthy

Function is_truthy 

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

JavaScript truthiness.

Upstream guards several schema decisions with a bare if (obj.key), which is not a presence test: "", 0, false and NaN are all present and all falsy, and an empty array or object is falsy in neither JavaScript nor here. Reading those guards as “is the key set” accepts metadata upstream refuses, and reading them as “is the key a string” refuses metadata upstream accepts.