Add store arg to sync $flowContext/$globalContext

This commit is contained in:
Nick O'Leary 2018-07-25 10:18:59 +01:00
parent 17e6940a42
commit 963ea4177e
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 6 additions and 6 deletions

View File

@ -189,11 +189,11 @@
"desc":"Returns an aggregated value derived from applying the `function` parameter successively to each value in `array` in combination with the result of the previous application of the function.\n\nThe function must accept two arguments, and behaves like an infix operator between each value within the `array`.\n\nThe optional `init` parameter is used as the initial value in the aggregation."
},
"$flowContext": {
"args": "string",
"args": "string[, string]",
"desc": "Retrieves a flow context property.\n\nThis is a Node-RED defined function."
},
"$globalContext": {
"args": "string",
"args": "string[, string]",
"desc": "Retrieves a global context property.\n\nThis is a Node-RED defined function."
},
"$pad": {

View File

@ -389,11 +389,11 @@ function evaluateNodeProperty(value, type, node, msg, callback) {
function prepareJSONataExpression(value,node) {
var expr = jsonata(value);
expr.assign('flowContext',function(val) {
return node.context().flow.get(val);
expr.assign('flowContext',function(val, store) {
return node.context().flow.get(val, store);
});
expr.assign('globalContext',function(val) {
return node.context().global.get(val);
expr.assign('globalContext',function(val, store) {
return node.context().global.get(val, store);
});
expr.assign('env', function(val) {
return process.env[val];