dist/modules/to.js
function toDefault(val, def) {
    if (is_1.isValue(val) && !(is_1.isEmpty(val) && !is_1.isEmpty(def)))
        return val;
    return is_1.isValue(def) ? def : null;
}
function toDefault(val, def) {
    if (is_1.isValue(val) && !(is_1.isEmpty(val) && !is_1.isEmpty(def)))
        return val;
    return is_1.isValue(def) ? def : null;
}
function toDefault ( val , def ) { if ( is_1 . isValue ( val ) && ! ( is_1 . isEmpty ( val ) && ! is_1 . isEmpty ( def ) ) ) return val ; return is_1 . isValue ( def ) ? def : null ; }
To Default
Returns a default value when provided if
primary value is null or undefined. If neither
then null is returned.

@param val the value to return if defined.
@param def an optional default value to be returned.
To Default Returns a default value when provided if primary value is null or undefined . If neither then null is returned .