dist/modules/to.js
function toBoolean(val, def) {
    if (is_1.isBoolean(val))
        return val;
    if (!is_1.isValue(val))
        return toDefault(null, def);
    val = val.toString();
    return (parseFloat(val) > 0 ||
        is_1.isInfinite(val) ||
        val === 'true' ||
        val === 'yes' ||
        val === '1' ||
        val === '+');
}
function toBoolean(val, def) {
    if (is_1.isBoolean(val))
        return val;
    if (!is_1.isValue(val))
        return toDefault(null, def);
    val = val.toString();
    return (parseFloat(val) > 0 ||
        is_1.isInfinite(val) ||
        val === 'true' ||
        val === 'yes' ||
        val === '1' ||
        val === '+');
}
function toBoolean ( val , def ) { if ( is_1 . isBoolean ( val ) ) return val ; if ( ! is_1 . isValue ( val ) ) return toDefault ( null , def ) ; val = val . toString ( ) ; return ( parseFloat ( val ) > 0 || is_1 . isInfinite ( val ) || val === 'true' || val === 'yes' || val === '1' || val === '+' ) ; }
To Boolean
Converts value if not boolean to boolean.
Will convert 'true', '1', 'yes' or '+' to true.

@param val the value to inspect.
@param def optional default value on null.
To Boolean Converts value if not boolean to boolean . Will convert true 1 yes or + to true .