safe-evaluate-expression
Advanced tools
Comparing version 1.6.1 to 1.7.0
@@ -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 @@ |
{ | ||
"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}`); |
54916
1051
184