Update Flow.js

replace tabs with whitespace
This commit is contained in:
NetHans 2022-08-16 06:37:03 +02:00
parent 371253a4f6
commit b7a016edcf
1 changed files with 22 additions and 22 deletions

View File

@ -137,32 +137,32 @@ class Flow {
* @param {[type]} nodeIdB [description] * @param {[type]} nodeIdB [description]
* @returns {[type]} 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. * @returns {[type]} 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) { isNodeInSameGroup(nodeIdA, nodeIdB) {
const groups = this.global.groups; const groups = this.global.groups;
let result = false; let result = false;
for(let key in groups) { for(let key in groups) {
let group = groups[key]; let group = groups[key];
if(!group.nodes.includes(nodeIdA.id)) { if(!group.nodes.includes(nodeIdA.id)) {
continue; continue;
} }
if(group.nodes.includes(nodeIdB.id)) { if(group.nodes.includes(nodeIdB.id)) {
result = true; result = true;
break; break;
} }
/** /**
* Subfunction to recursively search the groups for matches * Subfunction to recursively search the groups for matches
* @param {[type]} targetNode [description] * @param {[type]} targetNode [description]
* @param {[type]} targetGroup [description] * @param {[type]} targetGroup [description]
* @returns Returns true if a match was found. Otherwise false. * @returns Returns true if a match was found. Otherwise false.
*/ */
const isInSubGroup = (targetNode, targetGroup) => { const isInSubGroup = (targetNode, targetGroup) => {
let _result = false; let _result = false;
if(targetGroup.nodes.includes(targetNode.id)) { if(targetGroup.nodes.includes(targetNode.id)) {
_result = true; _result = true;
} else { } else {
for(let nodeId of targetGroup.nodes) { for(let nodeId of targetGroup.nodes) {
let node = this.getGroupNode(nodeId); let node = this.getGroupNode(nodeId);
@ -180,13 +180,13 @@ class Flow {
} }
} }
return _result; return _result;
}; };
result = isInSubGroup(nodeIdB, group); result = isInSubGroup(nodeIdB, group);
} }
return result; return result;
} }
/** /**
* Start this flow. * Start this flow.