MCPcopy Index your code
hub / github.com/simstudioai/sim / canReachSource

Function canReachSource

apps/sim/stores/workflows/workflow/utils.ts:44–63  ·  view source on GitHub ↗
(currentNode: string)

Source from the content-addressed store, hash-verified

42 const visited = new Set<string>()
43
44 function canReachSource(currentNode: string): boolean {
45 if (currentNode === sourceId) {
46 return true
47 }
48
49 if (visited.has(currentNode)) {
50 return false
51 }
52
53 visited.add(currentNode)
54
55 const neighbors = adjacencyList.get(currentNode) || []
56 for (const neighbor of neighbors) {
57 if (canReachSource(neighbor)) {
58 return true
59 }
60 }
61
62 return false
63 }
64
65 return canReachSource(targetId)
66}

Callers 1

wouldCreateCycleFunction · 0.85

Calls 2

getMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected