MCPcopy Create free account
hub / github.com/ShipSecAI/studio / hasPath

Function hasPath

frontend/src/utils/connectionValidation.ts:183–191  ·  view source on GitHub ↗
(from: string, to: string)

Source from the content-addressed store, hash-verified

181 const visited = new Set<string>();
182
183 function hasPath(from: string, to: string): boolean {
184 if (from === to) return true;
185 if (visited.has(from)) return false;
186
187 visited.add(from);
188
189 const outgoingEdges = existingEdges.filter((edge) => edge.source === from);
190 return outgoingEdges.some((edge) => hasPath(edge.target, to));
191 }
192
193 return hasPath(target, source);
194}

Callers 1

wouldCreateCycleFunction · 0.85

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected