MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / as_boolean

Method as_boolean

aiscript-vm/src/value.rs:173–180  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

171 }
172
173 pub fn as_boolean(&self) -> bool {
174 match self {
175 Value::Boolean(value) => *value,
176 Value::Number(value) => *value != 0.0,
177 Value::String(s) => !s.is_empty(),
178 _ => false,
179 }
180 }
181
182 pub fn as_string(self) -> Result<InternedString<'gc>, VmError> {
183 match self {

Callers 5

is_falsyMethod · 0.80
_run_agentFunction · 0.80
io_remove_dirFunction · 0.80
printFunction · 0.80
sortFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected