Add _path property to nodes and expose as node.path in Function node

This commit is contained in:
Nick O'Leary
2022-01-25 21:32:28 +00:00
parent c136d22382
commit 703c5adba7
4 changed files with 29 additions and 19 deletions

View File

@@ -85,6 +85,7 @@ function createNode(flow,config) {
try {
Object.defineProperty(conf,'_module', {value: typeRegistry.getNodeInfo(type), enumerable: false, writable: true })
Object.defineProperty(conf,'_flow', {value: flow, enumerable: false, writable: true })
Object.defineProperty(conf,'_path', {value: `${flow.path}/${config._alias||config.id}`, enumerable: false, writable: true })
newNode = new nodeTypeConstructor(conf);
} catch (err) {
Log.log({

View File

@@ -62,6 +62,9 @@ function Node(n) {
if (n._module) {
Object.defineProperty(this,'_module', {value: n._module, enumerable: false, writable: true })
}
if (n._path) {
Object.defineProperty(this,'_path', {value: n._path, enumerable: false, writable: true })
}
this.updateWires(n.wires);
}