json-logic-js
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
282158
20
825