Ensures a default value when current is undefined.

@param val the current value.
@param def the default value.
function ensureDefault(val, def) {
    if ((util_1.isNullOrUndefined(val) || val === '') && !chek_1.isUndefined(def))
        return def;
    return val;
}