safe-evaluate-expression
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "safe-evaluate-expression", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Small library to dynamically create and evaluate expression with multiple parameters (even undefined)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -19,9 +19,11 @@ # safe-evaluate-expression | ||
const params = { a: 1, b: 1, c: 2 }; | ||
const operators = { isUndefined, isEqual }; | ||
const vars = { a: 1, b: 1, c: 2 }; | ||
const params = { ...vars, ...operators }; | ||
evaluate("isEqual(a,b)", params); // -> true | ||
evaluate("isEqual(a,c)", params); // -> false | ||
evaluate("isEqual(a,notExisting)", params); // -> false | ||
evaluate("isEqual(a,notDefined)", params); // -> false | ||
evaluate("isUndefined(a)", params); // -> false | ||
evaluate("isUndefined(notExisting)", params); // -> true | ||
evaluate("isUndefined(notDefined)", params); // -> true | ||
``` |
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
14167
29