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

Method visit

packages/effect/src/Codegen.ts:625–635  ·  view source on GitHub ↗
(binding: Binding)

Source from the content-addressed store, hash-verified

623 const visited = new Set<Binding>()
624 const ordered: Array<Declaration> = []
625 const visit = (binding: Binding): void => {
626 if (visited.has(binding) || hasProperty(binding, "import")) return
627 if (visiting.has(binding)) throw new Error(`Cyclic initialization dependency: ${binding.preferredName}`)
628 const declaration = this.#declarations.get(binding)
629 if (declaration === undefined) throw new Error(`Missing definition: ${binding.preferredName}`)
630 visiting.add(binding)
631 for (const dependency of declaration.dependencies) visit(dependency)
632 visiting.delete(binding)
633 visited.add(binding)
634 ordered.push(declaration)
635 }
636 for (const binding of this.#declarations.keys()) visit(binding)
637
638 const names = new Map(this.#bindings)

Callers 5

Graph.test.tsFile · 0.45
indicesFunction · 0.45
valuesFunction · 0.45
entriesFunction · 0.45
stackChainsFunction · 0.45

Calls 7

hasPropertyFunction · 0.90
visitFunction · 0.70
hasMethod · 0.65
getMethod · 0.65
addMethod · 0.65
deleteMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected