MCPcopy Create free account
hub / github.com/arktypeio/arktype / visit

Function visit

ark/aot/flat.ts:982–993  ·  view source on GitHub ↗
(unit: UnitModule)

Source from the content-addressed store, hash-verified

980 const ordered: UnitModule[] = []
981 const state = new Map<string, "visiting" | "done">()
982 const visit = (unit: UnitModule): boolean => {
983 if (state.get(unit.specifier) === "done") return true
984 if (state.get(unit.specifier) === "visiting") return false
985 state.set(unit.specifier, "visiting")
986 for (const source of importsOf(unit.module)) {
987 const read = units.get(source)
988 if (read && !visit(read)) return false
989 }
990 state.set(unit.specifier, "done")
991 ordered.push(unit)
992 return true
993 }
994 for (const unit of units.values()) if (!visit(unit)) return
995 // two modules declaring a name would declare it twice in one function
996 const declared = new Set<string>()

Callers 12

unitsOfFunction · 0.70
visitMethod · 0.70
methodsOfMethod · 0.70
componentOfMethod · 0.70
visitMethod · 0.70
visitExportsMethod · 0.70
standInsReachedByMethod · 0.70
evaluateConfigurationMethod · 0.70
visitMethod · 0.70
exportsHoldingMethod · 0.70
inScopeMethod · 0.70
walkFunction · 0.70

Calls 4

importsOfFunction · 0.70
getMethod · 0.65
setMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected