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

safe-evaluate-expression

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

safe-evaluate-expression - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"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
```
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