2 Commits

Author SHA1 Message Date
17287a9ba3 1.0.9 2020-01-23 18:09:10 +00:00
11921a2864 fix(core): update 2020-01-23 18:09:09 +00:00
3 changed files with 4 additions and 2 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartrule", "name": "@pushrocks/smartrule",
"version": "1.0.8", "version": "1.0.9",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartrule", "name": "@pushrocks/smartrule",
"version": "1.0.8", "version": "1.0.9",
"private": false, "private": false,
"description": "a smart rule library for handling decision trees.", "description": "a smart rule library for handling decision trees.",
"main": "dist/index.js", "main": "dist/index.js",

View File

@@ -32,6 +32,8 @@ export class SmartRule<T> {
const outcomes: TTreeActionResult[] = []; const outcomes: TTreeActionResult[] = [];
for (const rule of nextBatch) { for (const rule of nextBatch) {
const checkResult = await rule.checkFunction(objectArg); const checkResult = await rule.checkFunction(objectArg);
checkResult ? null : console.log('WARNING!!! Please make sure your rule always returns a statement of how to continue!');
if (checkResult.startsWith("apply")) { if (checkResult.startsWith("apply")) {
await rule.actionFunction(objectArg); // here the action function is run await rule.actionFunction(objectArg); // here the action function is run
} }