From b1a706f811b03e6f3dd51e142843b67fe627819e Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 12 Jan 2022 18:04:53 +0000 Subject: [PATCH] Add comment on RED.nodes.getNodeLinkCount api --- packages/node_modules/@node-red/editor-client/src/js/nodes.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/node_modules/@node-red/editor-client/src/js/nodes.js b/packages/node_modules/@node-red/editor-client/src/js/nodes.js index b84304757..d0a27bde9 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/nodes.js +++ b/packages/node_modules/@node-red/editor-client/src/js/nodes.js @@ -2717,6 +2717,10 @@ RED.nodes = (function() { return []; }, getNodeLinkCount: function(id,portType,index) { + // We *could* just let callers use `getNodeLinks` and get the + // the length for themselves. However, that function creates + // a clone of the array - which is needless work if all you + // want is the length if (nodeLinks[id]) { if (portType === 1) { return nodeLinks[id].inCount[index] || 0