contains.js
// test whether the object obj contains the item as a subset
test whether the object obj contains the item as a subset
test whether the object obj contains the item as a subset
function _objectContains( obj, item, asStrict ) {
    if (isContainerObject(item)) {
        if (!(typeof obj === 'object')) return false;
        for (var k in item) if (!(k in obj) || !deepEqual(item[k], obj[k], asStrict)) return false;
        return true;
    }
    else {
        for (var k in obj) if (deepEqual(obj[k], item, asStrict)) return true;
        return false;
    }
}
function _objectContains ( obj , item , asStrict ) { if ( isContainerObject ( item ) ) { if ( ! ( typeof obj === 'object' ) ) return false ; for ( var k in item ) if ( ! ( k in obj ) || ! deepEqual ( item [ k ] , obj [ k ] , asStrict ) ) return false ; return true ; } else { for ( var k in obj ) if ( deepEqual ( obj [ k ] , item , asStrict ) ) return true ; return false ; } }
test whether the object obj contains the item as a subset
test whether the object obj contains the item as a subset
// all fields from item must be present // any field may equal item