1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add RED.nodes.getNodeLinks to help node-link lookup

This commit is contained in:
Nick O'Leary 2022-01-03 23:27:25 +00:00
parent 43651135f3
commit 24b52f09df
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -2551,7 +2551,17 @@ RED.nodes = (function() {
addLink: addLink, addLink: addLink,
removeLink: removeLink, removeLink: removeLink,
getNodeLinks: function(id, portType) {
if (nodeLinks[id]) {
if (portType === 1) {
// Return cloned arrays so they can be safely modified by caller
return [].concat(nodeLinks[id].in)
} else {
return [].concat(nodeLinks[id].out)
}
}
return [];
},
addWorkspace: addWorkspace, addWorkspace: addWorkspace,
removeWorkspace: removeWorkspace, removeWorkspace: removeWorkspace,
getWorkspaceOrder: function() { return workspacesOrder }, getWorkspaceOrder: function() { return workspacesOrder },