4 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
9035fafdc2 1.0.8 2020-01-23 16:52:22 +00:00
773ae00517 fix(core): update 2020-01-23 16:52:22 +00:00
3 changed files with 5 additions and 3 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartrule", "name": "@pushrocks/smartrule",
"version": "1.0.7", "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.7", "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,8 +32,10 @@ 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); await rule.actionFunction(objectArg); // here the action function is run
} }
outcomes.push(checkResult); outcomes.push(checkResult);
} }