MCPcopy Create free account
hub / github.com/eventuallyconsultant/codegenr / is_truthy

Function is_truthy

codegenr/src/helpers/handlebars_ext.rs:97–106  ·  view source on GitHub ↗
(json: &Value)

Source from the content-addressed store, hash-verified

95 self.param(index).map(|p| is_truthy(p.value()))
96 }
97
98 fn get_param_as_bool_or_fail(&self, index: usize, helper_name: &str) -> Result<bool, RenderError> {
99 self
100 .get_param_as_bool(index)
101 .ok_or_else(|| RenderError::new(format!("There should be a {} argument for `{}` helper.", index, helper_name)))
102 }
103
104 fn get_param_as_integer(&self, index: usize) -> Option<u64> {
105 self.param(index).map(|p| p.value().as_u64()).flatten()
106 }
107}
108
109fn is_truthy(json: &Value) -> bool {

Callers 1

get_param_as_boolMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected