src/compare.js
function( a, b, aParent, bParent, parentProp, compares, options ){
		var bType = typeof b;
		var hasAdditionalProp = false;
		if(bType === 'object' || bType === 'function') {
			var aCopy = assign({}, a);
			if(options.deep === false) {
				options.deep = -1;
			}
			// Check that everything in B is the same as whats in A, or
			// isn't in A.
			for (var prop in b) {
				var compare = compares[prop] === undefined ? compares['*'] : compares[prop];
				// run the comparison no matter what
				var compareResult = loop(a[prop], b[prop], a, b, prop, compare, options );
				// if there wasn't a prop (and we didn't run through a compare)
				if(compareResult === h.ignoreType) {
					// do nothing
				} else if(!(prop in a) ||  options.performedDifference ) {
					hasAdditionalProp = true;
				} else if(!compareResult) {
					return false;
				}
				delete aCopy[prop];
			}
			// go through aCopy props ... if there is no compare .. return false
			for (prop in aCopy) {
				if (compares[prop] === undefined || !loop(a[prop], undefined, a, b, prop, compares[prop], options) ) {
					return false;
				}
			}
			return hasAdditionalProp;
		}

	}
function( a, b, aParent, bParent, parentProp, compares, options ){
		var bType = typeof b;
		var hasAdditionalProp = false;
		if(bType === 'object' || bType === 'function') {
			var aCopy = assign({}, a);
			if(options.deep === false) {
				options.deep = -1;
			}
			// Check that everything in B is the same as whats in A, or
			// isn't in A.
			for (var prop in b) {
				var compare = compares[prop] === undefined ? compares['*'] : compares[prop];
				// run the comparison no matter what
				var compareResult = loop(a[prop], b[prop], a, b, prop, compare, options );
				// if there wasn't a prop (and we didn't run through a compare)
				if(compareResult === h.ignoreType) {
					// do nothing
				} else if(!(prop in a) ||  options.performedDifference ) {
					hasAdditionalProp = true;
				} else if(!compareResult) {
					return false;
				}
				delete aCopy[prop];
			}
			// go through aCopy props ... if there is no compare .. return false
			for (prop in aCopy) {
				if (compares[prop] === undefined || !loop(a[prop], undefined, a, b, prop, compares[prop], options) ) {
					return false;
				}
			}
			return hasAdditionalProp;
		}

	}
function ( a , b , aParent , bParent , parentProp , compares , options ) { var bType = typeof b ; var hasAdditionalProp = false ; if ( bType === 'object' || bType === 'function' ) { var aCopy = assign ( { } , a ) ; if ( options . deep === false ) { options . deep = - 1 ; } // Check that everything in B is the same as whats in A, or // isn't in A. for ( var prop in b ) { var compare = compares [ prop ] === undefined ? compares [ '*' ] : compares [ prop ] ; // run the comparison no matter what var compareResult = loop ( a [ prop ] , b [ prop ] , a , b , prop , compare , options ) ; // if there wasn't a prop (and we didn't run through a compare) if ( compareResult === h . ignoreType ) { // do nothing } else if ( ! ( prop in a ) || options . performedDifference ) { hasAdditionalProp = true ; } else if ( ! compareResult ) { return false ; } delete aCopy [ prop ] ; } // go through aCopy props ... if there is no compare .. return false for ( prop in aCopy ) { if ( compares [ prop ] === undefined || ! loop ( a [ prop ] , undefined , a , b , prop , compares [ prop ] , options ) ) { return false ; } } return hasAdditionalProp ; } }
returns true if A is superset of B A is a superset if it has fewer properties
returns true if A is superset of B A is a superset if it has fewer properties