New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

quri

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quri - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

41

dist/quri.js

@@ -105,5 +105,3 @@ 'use strict';

value: function appendCriteria(criteria) {
this._criteria.push({
criteria: criteria
});
this._criteria.push(criteria);
return this;

@@ -135,5 +133,10 @@ }

var criteriaMap = this._criteria.map(function (item) {
if (item.criteria != null) {
return '(' + item.criteria.toString() + ')';
if (typeof item === 'string') {
return '(' + item + ')';
}
if (item instanceof Quri || !item.field || !item.operator) {
return '(' + item.toString() + ')';
}
var fieldString = JSON.stringify(item.field);

@@ -181,4 +184,6 @@ var operatorString = Quri.operatorToString(item.operator);

if (item.criteria != null) {
object.criteria.push(item.criteria.toJS(options));
if (item instanceof Quri) {
object.criteria.push(item.toJS(options));
} else if (typeof item === 'string' || !item.field || !item.operator) {
object.criteria.push(item);
} else {

@@ -254,2 +259,6 @@ var field = item.field;

value: function fromJS(object) {
if (!object) {
return new Quri();
}
var quri = new Quri(object.conjunction);

@@ -265,9 +274,7 @@

if (item.criteria) {
// Assume objects with a criteria property
// should become Quri instances.
var innerQuri = Quri.fromJS(item);
quri.appendQuri(innerQuri);
} else if (item.field) {
if (item instanceof Quri || item.criteria) {
// Clone quri instances with fromJS to avoid mutating data.
// Assume any objects with a criteria property should become Quri instances.
quri.appendQuri(Quri.fromJS(item));
} else if (item.field && item.operator) {
// Assume an expression object

@@ -279,4 +286,4 @@ var field = item.field;

quri.appendExpression(field, operator, value);
} else if (item.length === 3) {
// Assume an iterable with 3 items is an expression.
} else if (Array.isArray(item) && item.length === 3) {
// Assume an array with 3 items is an expression.

@@ -291,3 +298,3 @@ var _item = _slicedToArray(item, 3);

} else {
// Assume anything else is a criteria object.
// Assume anything else is a string or toString-able criteria object.
quri.appendCriteria(item);

@@ -294,0 +301,0 @@ }

{
"name": "quri",
"version": "1.0.3",
"version": "1.1.0",
"description": "JS wrapper for the QURI string specification",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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