How to use the can-query-logic/src/set.defineComparison function in can-query-logic

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 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;
}