json-rules-engine
Advanced tools
Comparing version 5.0.0-alpha3 to 5.0.0
@@ -1,4 +0,4 @@ | ||
#### 5.0.0 / 2019-10-27 | ||
#### 5.0.0 / 2019-11-29 | ||
* BREAKING CHANGES | ||
* Rule conditions' `path` property is now interpretted using [json-path](https://goessner.net/articles/JsonPath/) | ||
* Rule conditions' `path` property is now interpreted using [json-path](https://goessner.net/articles/JsonPath/) | ||
* To continue using the old syntax (provided via [selectn](https://github.com/wilmoore/selectn.js)), `npm install selectn` as a direct dependency, and `json-rules-engine` will continue to interpret legacy paths this way. | ||
@@ -5,0 +5,0 @@ * Any path starting with `$` will be assumed to use `json-path` syntax |
@@ -159,3 +159,10 @@ 'use strict'; | ||
return factValuePromise.then(function (factValue) { | ||
return (0, _jsonpathPlus.JSONPath)({ path: path, json: factValue }); | ||
if ((0, _lodash2.default)(factValue)) { | ||
var pathValue = (0, _jsonpathPlus.JSONPath)({ path: path, json: factValue, wrap: false }); | ||
(0, _debug2.default)('condition::evaluate extracting object property ' + path + ', received: ' + pathValue); | ||
return pathValue; | ||
} else { | ||
(0, _debug2.default)('condition::evaluate could not compute object path(' + path + ') of non-object: ' + factValue + ' <' + (typeof factValue === 'undefined' ? 'undefined' : _typeof(factValue)) + '>; continuing with ' + factValue); | ||
return factValue; | ||
} | ||
}); | ||
@@ -162,0 +169,0 @@ } else { |
{ | ||
"name": "json-rules-engine", | ||
"version": "5.0.0-alpha3", | ||
"version": "5.0.0", | ||
"description": "Rules Engine expressed in simple json", | ||
@@ -64,3 +64,2 @@ "main": "dist/index.js", | ||
"perfy": "^1.1.5", | ||
"selectn": "^1.1.2", | ||
"sinon": "^7.5.0", | ||
@@ -67,0 +66,0 @@ "sinon-chai": "^3.3.0", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
72804
19
1330
0