Description

ToBoolean will convert the value to a boolean (bool).

ToValue(0).ToBoolean() => false
ToValue("").ToBoolean() => false
ToValue(true).ToBoolean() => true
ToValue(1).ToBoolean() => true
ToValue("Nothing happens").ToBoolean() => true

If there is an error during the conversion process (like an uncaught exception), then the result will be false and an error.

ToBoolean is referenced in 11 repositories

github.com/stretchr/ottox github.com/sfreiberg/shepherd github.com/couchbaselabs/cbgb

...