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

Function positionOf

ark/schema/units.ts:1065–1066  ·  view source on GitHub ↗
(id: NodeId)

Source from the content-addressed store, hash-verified

1063 const calleeIds: NodeId[] = []
1064 const positionsById: Record<NodeId, number> = {}
1065 const positionOf = (id: NodeId) =>
1066 id === node.id ? "$" : `$${(positionsById[id] ??= calleeIds.push(id) - 1)}`
1067 const link = createLinkage(positionOf, s.opts)
1068 declareTraversals(link, node)
1069 // vb and mb on a failSite cache compiled error builders on first failure, not content

Callers 1

serializeFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected