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

Function nameReferences

ark/schema/units.ts:949–969  ·  view source on GitHub ↗
(
	roots: readonly BaseNode[],
	occurrencesById: Record<NodeId, number>,
	opts: UnitOptions
)

Source from the content-addressed store, hash-verified

947}
948
949const nameReferences = (
950 roots: readonly BaseNode[],
951 occurrencesById: Record<NodeId, number>,
952 opts: UnitOptions
953): ContentNamingState => {
954 const s: ContentNamingState = {
955 byId: {},
956 reached: [],
957 stack: [],
958 components: [],
959 opts,
960 valueIndices: new Map(),
961 names: {},
962 inputsByHash: {},
963 occurrencesById,
964 identityNamed: new Set(),
965 written: writtenOf(opts)
966 }
967 for (const root of roots) if (!s.byId[root.id]) nameReference(s, root)
968 return s
969}
970
971// content-equal nodes a cycle keys by id are numbered apart
972const occurrencesOfResolutions = (

Callers 1

nameContentFunction · 0.85

Calls 2

nameReferenceFunction · 0.85
writtenOfFunction · 0.70

Tested by

no test coverage detected