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

Function elementAt

ark/schema/node.ts:1795–1798  ·  view source on GitHub ↗
(node: Sequence.Node, length: number, i: number)

Source from the content-addressed store, hash-verified

1793}
1794
1795const elementAt = (node: Sequence.Node, length: number, i: number): BaseNode =>
1796 i < node.leading.length ? node.leading[i].node
1797 : i >= length - node.postLen ? node.postfix![i - length + node.postLen]
1798 : node.variadic!
1799
1800const simulatedEntriesOf = (node: BaseNode): BaseNode["kv"] =>
1801 node.is("sequence") && node.inner.minVariadicLength ?

Callers 1

isSequenceSimulatedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected