From 991f13e704f0ae2f979bd7a4ef1d4ca92cceb8de Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 22 May 2023 23:14:31 +0100 Subject: [PATCH] Remove unused function --- .../@node-red/runtime/lib/flows/Flow.js | 59 ------------------- 1 file changed, 59 deletions(-) diff --git a/packages/node_modules/@node-red/runtime/lib/flows/Flow.js b/packages/node_modules/@node-red/runtime/lib/flows/Flow.js index 4430e59ed..489ec42cb 100644 --- a/packages/node_modules/@node-red/runtime/lib/flows/Flow.js +++ b/packages/node_modules/@node-red/runtime/lib/flows/Flow.js @@ -128,65 +128,6 @@ class Flow { } this.parent.log(msg); } - - /** - * Checks if node A and node B are in the same group. - * Node B can also be placed in a subgroup. - * If node A is not in any group, false is returned - * @param {Node} nodeIdA Node which defines the first search level - * @param {Node} nodeIdB Node which is to be searched in the group or a subgroup - * @returns {boolean} Returns true if all nodes are in the same group. If not, then false or if node A is not in a group then also false. - */ - isNodeInSameGroup(nodeIdA, nodeIdB) { - const groups = this.global.groups; - let result = false; - for(let key in groups) { - let group = groups[key]; - - if(!group.nodes.includes(nodeIdA.id)) { - continue; - } - - if(group.nodes.includes(nodeIdB.id)) { - result = true; - break; - } - - /** - * Subfunction to recursively search the groups for matches - * @param {Node} Node which is to be searched in the group or a subgroup - * @param {Group} targetGroup group currently under analysis - * @returns {boolean} Returns true if a match was found. Otherwise false. - */ - const isInSubGroup = (targetNode, targetGroup) => { - let _result = false; - if(targetGroup.nodes.includes(targetNode.id)) { - _result = true; - } else { - for(let nodeId of targetGroup.nodes) { - let node = this.getGroupNode(nodeId); - - if(!node){ - continue; - } - - if(node.type === "group"){ - let result = isInSubGroup(targetNode, node); - if(result === true){ - _result = true; - break; - } - } - } - } - - return _result; - }; - - result = isInSubGroup(nodeIdB, group); - } - return result; - } /** * Start this flow.