dist/modules/to.js
function toInteger(val, def) {
    if (!is_1.isValue(val))
        return toDefault(null, def);
    var parsed = function_1.tryWrap(parseInt, val)(def);
    if (is_1.isInteger(parsed))
        return parsed;
    if (toBoolean(val))
        return 1;
    return 0;
}
function toInteger(val, def) {
    if (!is_1.isValue(val))
        return toDefault(null, def);
    var parsed = function_1.tryWrap(parseInt, val)(def);
    if (is_1.isInteger(parsed))
        return parsed;
    if (toBoolean(val))
        return 1;
    return 0;
}
function toInteger ( val , def ) { if ( ! is_1 . isValue ( val ) ) return toDefault ( null , def ) ; var parsed = function_1 . tryWrap ( parseInt , val ) ( def ) ; if ( is_1 . isInteger ( parsed ) ) return parsed ; if ( toBoolean ( val ) ) return 1 ; return 0 ; }
To Integer
Convert value to integer.

@param val the value to convert to integer.
@param def optional default value on null or error.
To Integer Convert value to integer .