Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

can-query-logic

Package Overview
Dependencies
Maintainers
5
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-query-logic - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

2

package.json
{
"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({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc