New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.6.1 to 1.7.0

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

## [1.7.0](https://bitbucket.org/ttessarolo/safe-evaluate-expression/branches/compare/v1.6.1%0Dv1.7.0) (2020-12-10)
### Features
* now supports floating numbers ([35bd489](https://github.com/ttessarolo/safe-evaluate-expression/commits/35bd489cb3a804f479953319c19226f05184baa4))
### [1.6.1](https://bitbucket.org/ttessarolo/safe-evaluate-expression/branches/compare/v1.6.0%0Dv1.6.1) (2020-12-09)

@@ -7,0 +14,0 @@

4

package.json
{
"name": "safe-evaluate-expression",
"version": "1.6.1",
"version": "1.7.0",
"description": "Small library to dynamically create and evaluate expression with multiple parameters (even undefined)",

@@ -26,2 +26,4 @@ "main": "index.js",

"evaluate",
"JsonLogic",
"Json Logic",
"dynamic",

@@ -28,0 +30,0 @@ "function",

@@ -48,4 +48,2 @@ # safe-evaluate-expression

_NB. As constant params in expression you can use only string and integers (eg. 1, "a") no floating numbers!_
## Advanced Example

@@ -52,0 +50,0 @@

@@ -9,4 +9,5 @@ 'use strict';

// const FUNC_PARAMS = /(["'])(?:(?=(\\?))\2.)*?\1|\b(\b(?!\w*\(|_\b)\w+\b)/g;
//const FUNC_PARAMS = /(["'])(?:(?=(\\?))\2.)*?\1|\b(\b(?!\w*\(|_\b)(\w|-)+\b)/g;
const FUNC_PARAMS = /(["'])(?:(?=(\\?))\2.)*?\1|\b(\b(?!\w*\(|_\b)(\w|-)+\b)/g;
const FUNC_PARAMS = /(["'])(?:(?=(\\?))\2.)*?\1|\b(\b(?!\w*\(|_\b)((\w|-)|([+-]?([0-9]*[.])?[0-9]+))+\b)/g;
const OPERA_EXT = /\b\w+(\w(\())/g;

@@ -13,0 +14,0 @@ const prefixOperators = (str) => str.replace(OPERA_EXT, (o) => `_.${o}`);

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