pico-engine-core
Advanced tools
Comparing version 0.5.0 to 0.6.0
{ | ||
"name": "pico-engine-core", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "The core javascript api for the pico-engine. (no http, logging, process management etc...)", | ||
@@ -40,5 +40,5 @@ "main": "src/index.js", | ||
"fibers": "^1.0.13", | ||
"krl-compiler": "^0.12.0", | ||
"krl-compiler": "^0.13.0", | ||
"krl-parser": "^0.11.0", | ||
"krl-stdlib": "^0.2.0", | ||
"krl-stdlib": "^0.3.0", | ||
"levelup": "^1.3.2", | ||
@@ -45,0 +45,0 @@ "lodash": "^4.13.1", |
var _ = require("lodash"); | ||
var λ = require("contra"); | ||
var applyInFiber = require("./applyInFiber"); | ||
var noopTrue = function(){ | ||
return true; | ||
}; | ||
@@ -14,6 +17,13 @@ var doPrelude = function(rule, ctx, callback){ | ||
var doActions = function(rule, ctx, callback){ | ||
var actions = _.get(rule, ["action_block", "actions"], []); | ||
λ.map(actions, function(action, done){ | ||
applyInFiber(action, null, [ctx], done); | ||
}, callback); | ||
var condition = _.get(rule, ["action_block", "condition"], noopTrue); | ||
applyInFiber(condition, null, [ctx], function(err, cond){ | ||
if(err) return callback(err); | ||
if(!cond){ | ||
return callback(); | ||
} | ||
var actions = _.get(rule, ["action_block", "actions"], []); | ||
λ.map(actions, function(action, done){ | ||
applyInFiber(action, null, [ctx], done); | ||
}, callback); | ||
}); | ||
}; | ||
@@ -20,0 +30,0 @@ |
@@ -302,2 +302,10 @@ var _ = require("lodash"); | ||
[{name: "and", options: {}}] | ||
], | ||
[ | ||
signal("events", "ifthen", {name: "something"}), | ||
[{name: "ifthen", options: {}}] | ||
], | ||
[ | ||
signal("events", "ifthen", {}), | ||
[] | ||
] | ||
@@ -304,0 +312,0 @@ ], t.end); |
34173
1115
+ Addedkrl-compiler@0.13.0(transitive)
+ Addedkrl-stdlib@0.3.0(transitive)
+ Addedrandom-words@0.0.1(transitive)
- Removedkrl-compiler@0.12.0(transitive)
- Removedkrl-stdlib@0.2.0(transitive)
Updatedkrl-compiler@^0.13.0
Updatedkrl-stdlib@^0.3.0