You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,14 @@
1
1
#### 6.0. / 2020-12-XX
2
2
* BREAKING CHANGES
3
-
* Private `rule.event` property renamed. Use `rule.getEvent()` to avoid breaking changes in the future.
3
+
*`path` support using `selectn` should use the `pathResolver` feature. Read more [here](). To continue using selectn, add the following to the engine constructor:
4
+
```js
5
+
constpathResolver= (value, path) => {
6
+
returnselectn(path)(value)
7
+
}
8
+
constengine=newEngine(rules, { pathResolver })
9
+
```
4
10
* Engine and Rule events `on('success')`, `on('failure')`, and Rule callbacks `onSuccess` and `onFailure` now honor returned promises; any event handler that returns a promise will be waited upon to resolve before engine execution continues. (fixes #235)
11
+
* Private `rule.event` property renamed. Use`rule.getEvent()` to avoid breaking changes in the future.
5
12
* The 'success-events' fact used to store successful events has been converted to an internal data structure and will no longer appear in the almanac's facts. (fixes #187)
debug(`condition::evaluate could not compute object path(${path}) of non-object: ${factValue} <${typeoffactValue}>; continuing with ${factValue}`)
137
-
returnfactValue
138
-
}
139
-
})
140
-
}else{
141
-
letselectn
142
-
try{
143
-
selectn=require('selectn')
144
-
}catch(err){
145
-
console.error('Oops! Looks like you\'re trying to use the deprecated syntax for the ".path" property.')
146
-
console.error('Please convert your "path" properties to JsonPath syntax (ensure your path starts with "$")')
147
-
console.error('Alternatively, if you wish to continue using old syntax (provided by selectn), you may "npm install selectn" as a direct dependency.')
148
-
console.error('See https://github.com/CacheControl/json-rules-engine/blob/master/CHANGELOG.md#500--2019-10-27 for more information.')
149
-
thrownewError('json-rules-engine: Unmet peer dependency "selectn" required for use of deprecated ".path" syntax. please "npm install selectn" or convert to json-path syntax')
0 commit comments