MCPcopy Create free account
hub / github.com/Effect-TS/effect / visit

Function visit

packages/effect/src/internal/schema/toCodeDocument.ts:163–176  ·  view source on GitHub ↗
(identifier: string)

Source from the content-addressed store, hash-verified

161 const stack: Array<string> = []
162
163 function visit(identifier: string): void {
164 const current = state.get(identifier) ?? 0
165 if (current === 1) {
166 const start = stack.indexOf(identifier)
167 for (let index = start; index < stack.length; index++) recursive.add(stack[index])
168 return
169 }
170 if (current === 2) return
171 state.set(identifier, 1)
172 stack.push(identifier)
173 for (const dependency of dependencies.get(identifier)!) visit(dependency)
174 stack.pop()
175 state.set(identifier, 2)
176 }
177
178 for (const identifier of identifiers) visit(identifier)
179

Callers 1

topologicalSortFunction · 0.70

Calls 4

pushMethod · 0.80
getMethod · 0.65
addMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected