dist/modules/object.js
function reverse(obj) {
    if (!is_1.isValue(obj))
        return null;
    // Reverse an array.
    if (is_1.isArray(obj))
        return obj.reverse();
    // Reverse a string.
    if (is_1.isString(obj)) {
        var i = obj.toString().length;
        var tmpStr = '';
        while (i--)
            tmpStr += obj[i];
        return tmpStr;
    }
    // Reverse an object.
    var result = {};
    for (var p in obj) {
        if (is_1.isObject(obj[p]))
            continue;
        result[obj[p]] = p;
    }
    return result;
}
function reverse(obj) {
    if (!is_1.isValue(obj))
        return null;
    // Reverse an array.
    if (is_1.isArray(obj))
        return obj.reverse();
    // Reverse a string.
    if (is_1.isString(obj)) {
        var i = obj.toString().length;
        var tmpStr = '';
        while (i--)
            tmpStr += obj[i];
        return tmpStr;
    }
    // Reverse an object.
    var result = {};
    for (var p in obj) {
        if (is_1.isObject(obj[p]))
            continue;
        result[obj[p]] = p;
    }
    return result;
}
function reverse ( obj ) { if ( ! is_1 . isValue ( obj ) ) return null ; // Reverse an array. if ( is_1 . isArray ( obj ) ) return obj . reverse ( ) ; // Reverse a string. if ( is_1 . isString ( obj ) ) { var i = obj . toString ( ) . length ; var tmpStr = '' ; while ( i -- ) tmpStr += obj [ i ] ; return tmpStr ; } // Reverse an object. var result = { } ; for ( var p in obj ) { if ( is_1 . isObject ( obj [ p ] ) ) continue ; result [ obj [ p ] ] = p ; } return result ; }
Reverse
Reverses arrays, strings or objects.
Only numbers, strings or booleans are supported
when reverse mapping objects.

@param obj the object to reverse.
Reverse Reverses arrays strings or objects . Only numbers strings or booleans are supported when reverse mapping objects .