src/aria/utils/Json.js
function (big, small) {
                var isBigArray = typeUtils.isArray(big), isBigObject = typeUtils.isObject(big), isSmallArray = typeUtils.isArray(small), isSmallObject = typeUtils.isObject(small);

                if (isBigArray && isSmallArray) {
                    for (var i = 0, l = small.length; i < l; i++) {
                        if (!this.contains(big[i], small[i])) {
                            return false;
                        }
                    }
                } else if (isBigObject && isSmallObject) {
                    for (var key in small) {
                        if (small.hasOwnProperty(key)) {
                            if (key.match(/:/)) {
                                continue; // meta-data: we don't copy them
                            }
                            if (small.hasOwnProperty(key)) {
                                if (!this.contains(big[key], small[key])) {
                                    return false;
                                }
                            }
                        }
                    }
                } else {
                    var allTime = (typeUtils.isDate(big) && typeUtils.isDate(small));
                    if (allTime) {
                        return (small.getTime() === big.getTime());
                    } else {
                        return small === big;
                    }
                }
                return true;
            }
function (big, small) {
                var isBigArray = typeUtils.isArray(big), isBigObject = typeUtils.isObject(big), isSmallArray = typeUtils.isArray(small), isSmallObject = typeUtils.isObject(small);

                if (isBigArray && isSmallArray) {
                    for (var i = 0, l = small.length; i < l; i++) {
                        if (!this.contains(big[i], small[i])) {
                            return false;
                        }
                    }
                } else if (isBigObject && isSmallObject) {
                    for (var key in small) {
                        if (small.hasOwnProperty(key)) {
                            if (key.match(/:/)) {
                                continue; // meta-data: we don't copy them
                            }
                            if (small.hasOwnProperty(key)) {
                                if (!this.contains(big[key], small[key])) {
                                    return false;
                                }
                            }
                        }
                    }
                } else {
                    var allTime = (typeUtils.isDate(big) && typeUtils.isDate(small));
                    if (allTime) {
                        return (small.getTime() === big.getTime());
                    } else {
                        return small === big;
                    }
                }
                return true;
            }
function ( big , small ) { var isBigArray = typeUtils . isArray ( big ) , isBigObject = typeUtils . isObject ( big ) , isSmallArray = typeUtils . isArray ( small ) , isSmallObject = typeUtils . isObject ( small ) ; if ( isBigArray && isSmallArray ) { for ( var i = 0 , l = small . length ; i < l ; i ++ ) { if ( ! this . contains ( big [ i ] , small [ i ] ) ) { return false ; } } } else if ( isBigObject && isSmallObject ) { for ( var key in small ) { if ( small . hasOwnProperty ( key ) ) { if ( key . match ( / : / ) ) { continue ; // meta-data: we don't copy them } if ( small . hasOwnProperty ( key ) ) { if ( ! this . contains ( big [ key ] , small [ key ] ) ) { return false ; } } } } } else { var allTime = ( typeUtils . isDate ( big ) && typeUtils . isDate ( small ) ) ; if ( allTime ) { return ( small . getTime ( ) === big . getTime ( ) ) ; } else { return small === big ; } } return true ; }
Checks whether a JSON object is fully contained in another.
@param {Object} big the container JSON structure
@param {Object} small the contained JSON structure
@return {Boolean} true if <i>small</i> is contained in <i>big</i>
Checks whether a JSON object is fully contained in another .