safe-evaluate-expression
Advanced tools
Comparing version 1.4.3 to 1.5.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [1.5.0](https://bitbucket.org/ttessarolo/safe-evaluate-expression/branches/compare/v1.4.3%0Dv1.5.0) (2020-12-03) | ||
### Features | ||
* added id to SimpleToComplex rule generator ([b6d537d](https://github.com/ttessarolo/safe-evaluate-expression/commits/b6d537d340e089d027482e9850b3cbe91246c706)) | ||
### [1.4.3](https://bitbucket.org/ttessarolo/safe-evaluate-expression/branches/compare/v1.4.2%0Dv1.4.3) (2020-12-03) | ||
@@ -7,0 +14,0 @@ |
{ | ||
"name": "safe-evaluate-expression", | ||
"version": "1.4.3", | ||
"version": "1.5.0", | ||
"description": "Small library to dynamically create and evaluate expression with multiple parameters (even undefined)", | ||
@@ -37,3 +37,5 @@ "main": "index.js", | ||
"homepage": "https://github.com/ttessarolo/safe-evaluate-expression#readme", | ||
"dependencies": {}, | ||
"dependencies": { | ||
"shortid": "^2.2.16" | ||
}, | ||
"devDependencies": { | ||
@@ -44,2 +46,3 @@ "ava": "^3.13.0", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"deep-cleaner": "^1.2.1", | ||
"eslint": "^7.2.0", | ||
@@ -46,0 +49,0 @@ "eslint-config-prettier": "^6.15.0", |
const { FUNC_PARAMS } = require('./factory'); | ||
const shortid = require('shortid'); | ||
const matchOR = /([^\s]+)OR([^\s]+)/g; | ||
@@ -30,3 +30,3 @@ | ||
return { operator, values }; | ||
return { id: shortid.generate(), operator, values }; | ||
} | ||
@@ -33,0 +33,0 @@ |
const test = require('ava'); | ||
const cleaner = require('deep-cleaner'); | ||
const { basicToComplex } = require('../'); | ||
@@ -387,3 +388,3 @@ | ||
test('test and or condition', (t) => { | ||
const result = basicToComplex(basic3); | ||
const result = cleaner(basicToComplex(basic3), ['id']); | ||
t.deepEqual(result, c3); | ||
@@ -393,3 +394,3 @@ }); | ||
test('test and or alternate condition', (t) => { | ||
const result = basicToComplex(basic6); | ||
const result = cleaner(basicToComplex(basic6), ['id']); | ||
t.deepEqual(result, c6); | ||
@@ -399,3 +400,3 @@ }); | ||
test('test or condition', (t) => { | ||
const result = basicToComplex(basic4); | ||
const result = cleaner(basicToComplex(basic4), ['id']); | ||
t.deepEqual(result, c4); | ||
@@ -405,3 +406,3 @@ }); | ||
test('test and condition', (t) => { | ||
const result = basicToComplex(basic5); | ||
const result = cleaner(basicToComplex(basic5), ['id']); | ||
t.deepEqual(result, c5); | ||
@@ -411,3 +412,3 @@ }); | ||
test('test always condition', (t) => { | ||
const result = basicToComplex(basic0); | ||
const result = cleaner(basicToComplex(basic0), ['id']); | ||
t.deepEqual(result, c0); | ||
@@ -417,3 +418,3 @@ }); | ||
test('test basic condition', (t) => { | ||
const result = basicToComplex(basic1); | ||
const result = cleaner(basicToComplex(basic1), ['id']); | ||
t.deepEqual(result, c1); | ||
@@ -423,3 +424,3 @@ }); | ||
test('test basic and condition', (t) => { | ||
const result = basicToComplex(basic2); | ||
const result = cleaner(basicToComplex(basic2), ['id']); | ||
t.deepEqual(result, c2); | ||
@@ -429,3 +430,3 @@ }); | ||
test('test basic7', (t) => { | ||
const result = basicToComplex(basic7); | ||
const result = cleaner(basicToComplex(basic7), ['id']); | ||
t.deepEqual(result, c7); | ||
@@ -435,4 +436,4 @@ }); | ||
test('test basic8', (t) => { | ||
const result = basicToComplex(basic8); | ||
const result = cleaner(basicToComplex(basic8), ['id']); | ||
t.deepEqual(result, c8); | ||
}); |
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
52312
990
1
15
+ Addedshortid@^2.2.16
+ Addednanoid@2.1.11(transitive)
+ Addedshortid@2.2.16(transitive)