forked from baron/baron-sso
린트 적용
This commit is contained in:
@@ -41,7 +41,9 @@ export function buildTenantFullTree(
|
||||
// Function to calculate recursive counts with cycle protection
|
||||
const calculateRecursive = (node: TenantNode): number => {
|
||||
if (visitedForCalc.has(node.id)) {
|
||||
console.warn(`Circular dependency detected in tenant tree for ID: ${node.id}`);
|
||||
console.warn(
|
||||
`Circular dependency detected in tenant tree for ID: ${node.id}`,
|
||||
);
|
||||
return 0; // Prevent infinite loop
|
||||
}
|
||||
visitedForCalc.add(node.id);
|
||||
@@ -51,8 +53,8 @@ export function buildTenantFullTree(
|
||||
total += calculateRecursive(child);
|
||||
}
|
||||
node.recursiveMemberCount = total;
|
||||
|
||||
// We don't remove from visitedForCalc here because a tree shouldn't have
|
||||
|
||||
// We don't remove from visitedForCalc here because a tree shouldn't have
|
||||
// multiple paths to the same node anyway (it's a tree, not a graph).
|
||||
// If it were a DAG, we'd need different logic, but for a tree with parentIds,
|
||||
// a node should only be visited once.
|
||||
|
||||
Reference in New Issue
Block a user