How to use can-query-logic - 8 common examples

To help you get started, we’ve selected a few can-query-logic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github canjs / can-fixture / matches.js View on Github external
function quickSubset(queryA, queryB){
	return set.isSubset( new QueryLogic.KeysAnd(queryA), new QueryLogic.KeysAnd(queryB) );
}
github canjs / can-fixture / matches.js View on Github external
function quickEqual(queryA, queryB){
	var dataA = queryA.data,
		dataB = queryB.data;
	if(dataA && dataB) {
		if(!deepMatches(dataA, dataB)) {
			return false;
		}
	}
	var q1 = new QueryLogic.KeysAnd(removeFixtureAndXHR(queryA)),
		q2 = new QueryLogic.KeysAnd(removeFixtureAndXHR(queryB));
	return set.isEqual( q1, q2 );
}
github canjs / can-fixture / matches.js View on Github external
function quickEqual(queryA, queryB){
	var dataA = queryA.data,
		dataB = queryB.data;
	if(dataA && dataB) {
		if(!deepMatches(dataA, dataB)) {
			return false;
		}
	}
	var q1 = new QueryLogic.KeysAnd(removeFixtureAndXHR(queryA)),
		q2 = new QueryLogic.KeysAnd(removeFixtureAndXHR(queryB));
	return set.isEqual( q1, q2 );
}
github canjs / can-fixture / matches.js View on Github external
function makeComparatorType(compare) {
	var Type = function(){};
	var SetType = function(value) {
		this.value = value;
	};
	SetType.prototype.isMember = function(value, root, keys){
	    return compare(this.value, value, root, keys);
	};
	canReflect.assignSymbols(Type,{
		"can.SetType": SetType
	});

	set.defineComparison(SetType,SetType, identityComparitor);

	set.defineComparison(set.UNIVERSAL,SetType,{
		difference: function(){
			return set.UNDEFINABLE;
		}
	});
	return Type;
}
github canjs / can-fixture / matches.js View on Github external
function makeComparatorType(compare) {
	var Type = function(){};
	var SetType = function(value) {
		this.value = value;
	};
	SetType.prototype.isMember = function(value, root, keys){
	    return compare(this.value, value, root, keys);
	};
	canReflect.assignSymbols(Type,{
		"can.SetType": SetType
	});

	set.defineComparison(SetType,SetType, identityComparitor);

	set.defineComparison(set.UNIVERSAL,SetType,{
		difference: function(){
			return set.UNDEFINABLE;
		}
	});
	return Type;
}
github canjs / can-fixture / matches.js View on Github external
difference: function(){
			return set.UNDEFINABLE;
		}
	});
github canjs / can-fixture / matches.js View on Github external
function quickEqual(queryA, queryB){
	var dataA = queryA.data,
		dataB = queryB.data;
	if(dataA && dataB) {
		if(!deepMatches(dataA, dataB)) {
			return false;
		}
	}
	var q1 = new QueryLogic.KeysAnd(removeFixtureAndXHR(queryA)),
		q2 = new QueryLogic.KeysAnd(removeFixtureAndXHR(queryB));
	return set.isEqual( q1, q2 );
}
github canjs / can-fixture / matches.js View on Github external
function identityIntersection(v1, v2) {
    return v1.value === v2.value ? v1 : set.EMPTY;
}
function identityDifference(v1, v2){