Socket
Socket
Sign inDemoInstall

@node-red/runtime

Package Overview
Dependencies
Maintainers
2
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-red/runtime - npm Package Compare versions

Comparing version 0.20.2 to 0.20.3

14

lib/nodes/flows/Flow.js

@@ -72,2 +72,16 @@ /**

/**
* Log an error-level message from this flow
* @param {[type]} msg [description]
* @return {[type]} [description]
*/
error(msg) {
Log.log({
id: this.id||"global",
level: Log.ERROR,
type:this.TYPE,
msg:msg
})
}
/**
* Log a info-level message from this flow

@@ -74,0 +88,0 @@ * @param {[type]} msg [description]

40

lib/nodes/flows/Subflow.js

@@ -266,13 +266,33 @@ /**

getSetting(name) {
var env = this.env;
if (env && env.hasOwnProperty(name)) {
var val = env[name];
try {
var ret = redUtil.evaluateNodeProperty(val.value, val.type, this.node, null, null);
return ret;
this.trace("getSetting:"+name);
if (!/^\$parent\./.test(name)) {
var env = this.env;
if (env && env.hasOwnProperty(name)) {
var val = env[name];
// If this is an env type property we need to be careful not
// to get into lookup loops.
// 1. if the value to lookup is the same as this one, go straight to parent
// 2. otherwise, check if it is a compound env var ("foo $(bar)")
// and if so, substitute any instances of `name` with $parent.name
// See https://github.com/node-red/node-red/issues/2099
if (val.type !== 'env' || val.value !== name) {
let value = val.value;
if (val.type === 'env') {
value = value.replace(new RegExp("\\${"+name+"}","g"),"${$parent."+name+"}");
}
try {
var ret = redUtil.evaluateNodeProperty(value, val.type, this.node, null, null);
return ret;
}
catch (e) {
this.error(e);
return undefined;
}
} else {
// This _is_ an env property pointing at itself - go to parent
}
}
catch (e) {
this.error(e);
return undefined;
}
} else {
// name starts $parent. ... so delegate to parent automatically
name = name.substring(8);
}

@@ -279,0 +299,0 @@ var parent = this.parent;

@@ -482,3 +482,3 @@ /**

try {
conf._flow = flow;
Object.defineProperty(conf,'_flow', {value: flow, enumerable: false, writable: true })
newNode = new nodeTypeConstructor(conf);

@@ -485,0 +485,0 @@ } catch (err) {

{
"name": "@node-red/runtime",
"version": "0.20.2",
"version": "0.20.3",
"license": "Apache-2.0",

@@ -19,4 +19,4 @@ "main": "./lib/index.js",

"dependencies": {
"@node-red/registry": "0.20.2",
"@node-red/util": "0.20.2",
"@node-red/registry": "0.20.3",
"@node-red/util": "0.20.3",
"clone": "2.1.2",

@@ -23,0 +23,0 @@ "express": "4.16.4",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc