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