MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / is_truthy

Method is_truthy

graphlite/src/exec/executor.rs:4889–4897  ·  view source on GitHub ↗

Check if a value is truthy for CASE condition evaluation

(&self, value: &Value)

Source from the content-addressed store, hash-verified

4887
4888 /// Check if a value is truthy for CASE condition evaluation
4889 fn is_truthy(&self, value: &Value) -> Result<bool, ExecutionError> {
4890 match value {
4891 Value::Boolean(b) => Ok(*b),
4892 Value::Number(n) => Ok(*n != 0.0),
4893 Value::String(s) => Ok(!s.is_empty()),
4894 Value::Null => Ok(false),
4895 _ => Ok(true), // Other types are considered truthy
4896 }
4897 }
4898
4899 /// Evaluate a PATH constructor: PATH[expr1, expr2, ...]
4900 fn evaluate_path_constructor(

Callers 2

evaluate_binary_opMethod · 0.80

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected