admin/desktop/browser.js
/**
 * Naive deepEqual. Doesn't check for prototype, non-enumerable or out-of-range properties on arrays.
 * If you have such a case, you probably should use this function but something fancier :).
 */
Naive deepEqual. Doesn't check for prototype, non-enumerable or out-of-range properties on arrays.
If you have such a case, you probably should use this function but something fancier :).
Naive deepEqual . Doesn ' t check for prototype non - enumerable or out - of - range properties on arrays . If you have such a case you probably should use this function but something fancier : ) .
function deepEqual(a, b) {
    if (a === null && b === null)
        return true;
    if (a === undefined && b === undefined)
        return true;
    if (areBothNaN(a, b))
        return true;
    if (typeof a !== "object")
        return a === b;
    var aIsArray = isArrayLike(a);
    var aIsMap = isMapLike(a);
    if (aIsArray !== isArrayLike(b)) {
        return false;
    }
    else if (aIsMap !== isMapLike(b)) {
        return false;
    }
    else if (aIsArray) {
        if (a.length !== b.length)
            return false;
        for (var i = a.length - 1; i >= 0; i--)
            if (!deepEqual(a[i], b[i]))
                return false;
        return true;
    }
    else if (aIsMap) {
        if (a.size !== b.size)
            return false;
        var equals_1 = true;
        a.forEach(function (value, key) {
            equals_1 = equals_1 && deepEqual(b.get(key), value);
        });
        return equals_1;
    }
    else if (typeof a === "object" && typeof b === "object") {
        if (a === null || b === null)
            return false;
        if (isMapLike(a) && isMapLike(b)) {
            if (a.size !== b.size)
                return false;
            return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());
        }
        if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)
            return false;
        for (var prop in a) {
            if (!(prop in b))
                return false;
            if (!deepEqual(a[prop], b[prop]))
                return false;
        }
        return true;
    }
    return false;
}
function deepEqual ( a , b ) { if ( a === null && b === null ) return true ; if ( a === undefined && b === undefined ) return true ; if ( areBothNaN ( a , b ) ) return true ; if ( typeof a !== "object" ) return a === b ; var aIsArray = isArrayLike ( a ) ; var aIsMap = isMapLike ( a ) ; if ( aIsArray !== isArrayLike ( b ) ) { return false ; } else if ( aIsMap !== isMapLike ( b ) ) { return false ; } else if ( aIsArray ) { if ( a . length !== b . length ) return false ; for ( var i = a . length - 1 ; i >= 0 ; i -- ) if ( ! deepEqual ( a [ i ] , b [ i ] ) ) return false ; return true ; } else if ( aIsMap ) { if ( a . size !== b . size ) return false ; var equals_1 = true ; a . forEach ( function ( value , key ) { equals_1 = equals_1 && deepEqual ( b . get ( key ) , value ) ; } ) ; return equals_1 ; } else if ( typeof a === "object" && typeof b === "object" ) { if ( a === null || b === null ) return false ; if ( isMapLike ( a ) && isMapLike ( b ) ) { if ( a . size !== b . size ) return false ; return deepEqual ( observable . shallowMap ( a ) . entries ( ) , observable . shallowMap ( b ) . entries ( ) ) ; } if ( getEnumerableKeys ( a ) . length !== getEnumerableKeys ( b ) . length ) return false ; for ( var prop in a ) { if ( ! ( prop in b ) ) return false ; if ( ! deepEqual ( a [ prop ] , b [ prop ] ) ) return false ; } return true ; } return false ; }
Naive deepEqual.
Naive deepEqual .
// Freaking inefficient.... Create PR if you run into this :) Much appreciated!