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

json-logic-js

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-logic-js - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

.idea/codeStyles/codeStyleConfig.xml

4

logic.js

@@ -131,3 +131,3 @@ /* globals define,module */

for(var i = 0; i < sub_props.length; i++) {
if(data === null) {
if(data === null || data === undefined) {
return not_found;

@@ -222,4 +222,2 @@ }

data = data || {};
var op = jsonLogic.get_operator(logic);

@@ -226,0 +224,0 @@ var values = logic[op];

{
"name": "json-logic-js",
"version": "1.2.2",
"version": "1.2.3",
"description": "Build complex rules, serialize them as JSON, and execute them in JavaScript",

@@ -5,0 +5,0 @@ "main": "logic.js",

@@ -123,2 +123,8 @@ var jsonLogic = require("../logic.js");

assert.equal( jsonLogic.apply(), undefined, "Called with no arguments" );
assert.equal( jsonLogic.apply({ var: "" }, 0), 0, "Var when data is 'falsy'" );
assert.equal( jsonLogic.apply({ var: "" }, null), null, "Var when data is null" );
assert.equal( jsonLogic.apply({ var: "" }, undefined), undefined, "Var when data is undefined" );
assert.equal( jsonLogic.apply({ var: ["a", "fallback"] }, undefined), "fallback", "Fallback works when data is a non-object" );
});

@@ -125,0 +131,0 @@

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