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

queryfilters

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

queryfilters - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

1

CHANGELOG.md

@@ -9,1 +9,2 @@ # Version 1.0

- add installation in readme file
- accept limited list of combinators

2

package.json
{
"name": "queryfilters",
"version": "v0.1.4",
"version": "v0.1.5",
"scripts": {

@@ -5,0 +5,0 @@ "test": "jest"

@@ -10,2 +10,4 @@ function QueryQl() {

this.combinators = ['filtering', 'or', 'and'];
this.applyFilter = function (filter) {

@@ -27,10 +29,15 @@ this.filters.push(filter);

this.getQueryString = function (combinator = null) {
this.setCombinator = function (combinator) {
this.combine = combinator;
return this;
};
this.getQueryString = function () {
if (!this.combinators.includes(this.combine)) {
throw new Error('combinator ' + this.combine + ' is not available');
}
var qs = '';
var rel = '';
if (combinator) {
this.combine = combinator;
}
for (f in this.filters) {

@@ -37,0 +44,0 @@ var filter = this.filters[f];

@@ -56,3 +56,3 @@ const QueryQl = require('./queryql');

for (i in operators) {
expect(queryQl.getQueryString(operators[i])).toEqual(
expect(queryQl.setCombinator(operators[i]).getQueryString()).toEqual(
'rel=relation,foo,bar'

@@ -64,1 +64,14 @@ + '&' + operators[i] + '[_embedded.relation.nick]=@sensorario'

});
test('accept limited list of combinator', () => {
var queryQl = new QueryQl()
var catched = false;
try {
queryQl.setCombinator('invalid').getQueryString()
} catch (e) {
catched = true;
}
expect(catched).toEqual(true);
});
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