Convert to Boolean

b = tools.bool(v)

Converts the value v to a pure Lua boolean:

v type Value Result
boolean false false
number 0 false
nil nil false
string '' (blank) false

Any other values are considered true.