can-query-logic
Advanced tools
Comparing version 1.1.5 to 1.1.6
{ | ||
"name": "can-query-logic", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "query data", | ||
@@ -5,0 +5,0 @@ "homepage": "", |
@@ -10,11 +10,8 @@ var QUnit = require("steal-qunit"); | ||
class DateStringSet { | ||
constructor(value) { | ||
this.value = value; | ||
} | ||
// used to convert to a number | ||
valueOf() { | ||
return this.value == null ? this.value : new Date(this.value).getTime(); | ||
} | ||
function DateStringSet(value) { | ||
this.value = value; | ||
} | ||
DateStringSet.prototype.valueOf = function() { | ||
return this.value == null ? this.value : new Date(this.value).getTime(); | ||
}; | ||
@@ -21,0 +18,0 @@ var ComparisonSet = function(value) { |
var QueryLogic = require("../can-query-logic"); | ||
var QUnit = require("steal-qunit"); | ||
var canReflect = require("can-reflect"); | ||
var canSymbol = require("can-symbol"); | ||
@@ -37,2 +38,6 @@ QUnit.module("can-query-logic special comparison logic"); | ||
var stringIncludes = function(strA, strB) { | ||
return strA.indexOf(strB) >= 0; | ||
}; | ||
QUnit.test("Searchable string", function(){ | ||
@@ -47,3 +52,3 @@ // Create a set type that is used to do comparisons. | ||
"can.isMember": function(value){ | ||
return value.includes(this.value); | ||
return stringIncludes(value, this.value); | ||
}, | ||
@@ -58,6 +63,6 @@ "can.serialize": function(){ | ||
union: function(searchA, searchB){ | ||
if(searchA.value.includes(searchB.value)) { | ||
if(stringIncludes(searchA.value, searchB.value)) { | ||
return searchB; | ||
} | ||
if(searchB.value.includes(searchA.value)) { | ||
if(stringIncludes(searchB.value, searchA.value)) { | ||
return searchA; | ||
@@ -69,6 +74,6 @@ } | ||
intersection: function(searchA, searchB){ | ||
if(searchA.value.includes(searchB.value)) { | ||
if(stringIncludes(searchA.value, searchB.value)) { | ||
return searchA; | ||
} | ||
if(searchB.value.includes(searchA.value)) { | ||
if(stringIncludes(searchB.value, searchA.value)) { | ||
return searchB; | ||
@@ -80,7 +85,7 @@ } | ||
// if a is a subset | ||
if(searchA.value.includes(searchB.value)) { | ||
if(stringIncludes(searchA.value, searchB.value)) { | ||
return QueryLogic.EMPTY; | ||
} | ||
// a is a superset | ||
if(searchB.value.includes(searchA.value)) { | ||
if(stringIncludes(searchB.value, searchA.value)) { | ||
return QueryLogic.UNDEFINABLE; | ||
@@ -108,3 +113,3 @@ } | ||
SearchableString[Symbol.for("can.SetType")] = SearchableStringSet; | ||
SearchableString[canSymbol.for("can.SetType")] = SearchableStringSet; | ||
@@ -111,0 +116,0 @@ var todoQueryLogic = new QueryLogic({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
391056
10820
1