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

krill

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

krill - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

16

lib/krill.js

@@ -29,3 +29,3 @@ /*

mod_jsprim.forEachKey(types, function (k, v) {
if (v !== 'string' && v !== 'number')
if (v !== 'string' && v !== 'number' && v !== 'boolean')
throw (new VError(

@@ -230,5 +230,7 @@ 'field "%s": unknown type "%s"', k, v));

'eq': new RelationalOperator(
'==', [ 'number', 'string' ], function (a, b) { return (a == b); }),
'==', [ 'number', 'string', 'boolean' ],
function (a, b) { return (a == b); }),
'ne': new RelationalOperator(
'!=', [ 'number', 'string' ], function (a, b) { return (a != b); }),
'!=', [ 'number', 'string', 'boolean' ],
function (a, b) { return (a != b); }),
'and': new LogicalOperator('&&'),

@@ -381,5 +383,7 @@ 'or': new LogicalOperator('||')

if (typeof (constant) != 'number' && typeof (constant) != 'string')
throw (new VError('predicate %j: field "%s" is not a string ' +
'or number'));
if (typeof (constant) != 'number' &&
typeof (constant) != 'string' &&
typeof (constant) != 'boolean')
throw (new VError('predicate %j: field "%s" is not a string, ' +
'number, or boolean', pred, key));
}

@@ -386,0 +390,0 @@

{
"name": "krill",
"description": "simple boolean filter language",
"version": "0.1.0",
"version": "0.2.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "contributors": [

@@ -37,2 +37,18 @@ /*

}, {
pred: { eq: ['audit', true] }, /* eq: booleans, == */
values: { 'audit': true },
result: true
}, {
pred: { eq: ['audit', false] }, /* eq: booleans, == */
values: { 'audit': true },
result: false
}, {
pred: { eq: ['audit', true] }, /* eq: booleans, != */
values: { 'audit': false },
result: false
}, {
pred: { eq: ['audit', false] }, /* eq: booleans, != */
values: { 'audit': false },
result: true
}, {
pred: { ne: ['hostname', 'tony'] }, /* ne: strings, != */

@@ -54,2 +70,18 @@ values: { 'hostname': 'louie' },

}, {
pred: { ne: ['audit', true] }, /* ne: booleans, == */
values: { 'audit': true },
result: false
}, {
pred: { ne: ['audit', false] }, /* ne: booleans, == */
values: { 'audit': true },
result: true
}, {
pred: { ne: ['audit', true] }, /* ne: booleans, != */
values: { 'audit': false },
result: true
}, {
pred: { ne: ['audit', false] }, /* ne: booleans, != */
values: { 'audit': false },
result: false
}, {
pred: { le: ['pid', 10] }, /* le: <, =, > */

@@ -56,0 +88,0 @@ values: { 'pid': 5 },

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