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

3xpr

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

3xpr - npm Package Compare versions

Comparing version 1.6.12 to 1.7.0

14

__tests__/auto/comparison.test.js

@@ -26,6 +26,12 @@ "use strict";

expect(__1.expressions.eval('includes(devices,"other")', context)).toStrictEqual(false);
expect(__1.expressions.eval('in(devices,"other")', context)).toStrictEqual(false);
expect(__1.expressions.eval('devices.in("phone")', context)).toStrictEqual(true);
expect(__1.expressions.eval('devices.in(device)', context)).toStrictEqual(true);
expect(__1.expressions.eval('["garage", "house","office"].in(d)', context)).toStrictEqual(true);
expect(__1.expressions.eval('contains(devices,"other")', context)).toStrictEqual(false);
expect(__1.expressions.eval('devices.contains("phone")', context)).toStrictEqual(true);
expect(__1.expressions.eval('devices.contains(device)', context)).toStrictEqual(true);
expect(__1.expressions.eval('in(device,devices)', context)).toStrictEqual(true);
expect(__1.expressions.eval('device.in(devices)', context)).toStrictEqual(true);
expect(__1.expressions.eval('in(2,[1,3,4])', context)).toStrictEqual(false);
expect(__1.expressions.eval('in(2,[1,2,3,4])', context)).toStrictEqual(true);
expect(__1.expressions.eval('["garage", "house","office"].includes(d)', context)).toStrictEqual(true);
expect(__1.expressions.eval('d.in(["garage", "house","office"])', context)).toStrictEqual(true);
expect(__1.expressions.eval('d.in("garage", "house","office")', context)).toStrictEqual(true);
expect(__1.expressions.eval('between(12,10,20)', context)).toStrictEqual(true);

@@ -32,0 +38,0 @@ expect(__1.expressions.eval('between(2,10,20)', context)).toStrictEqual(false);

@@ -102,3 +102,14 @@ "use strict";

this.model.addFunction('includes(source:string|T[],value:string|T):boolean', (source, value) => source && value ? source.includes(value) : false);
this.model.addFunctionAlias('in', 'includes');
this.model.addFunctionAlias('contains', 'includes');
this.model.addFunction('in(source:T,...values:T):boolean', (source, ...values) => {
if (source === undefined || values === undefined) {
return false;
}
if (values.length === 1 && Array.isArray(values)) {
return values[0].includes(source);
}
else {
return values.includes(source);
}
});
this.model.addFunction('isNull(value:any):boolean', (value) => h3lp_1.h3lp.val.isNull(value));

@@ -105,0 +116,0 @@ this.model.addFunction('isNotNull(value:any):boolean', (value) => h3lp_1.h3lp.val.isNotNull(value));

{
"name": "3xpr",
"version": "1.6.12",
"version": "1.7.0",
"description": "expressions",

@@ -5,0 +5,0 @@ "author": "Flavio Lionel Rita <flaviolrita@hotmail.com>",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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