mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add store arg to sync $flowContext/$globalContext
This commit is contained in:
parent
17e6940a42
commit
963ea4177e
@ -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": {
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user