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

Method tApply

ark/schema/structure/sequence.ts:371–385  ·  view source on GitHub ↗
(data: array, ctx: InternalTraversal)

Source from the content-addressed store, hash-verified

369 }
370
371 tApply(data: array, ctx: InternalTraversal): void {
372 const errN = ctx.errN
373 let i = 0
374 for (; i < data.length; i++) {
375 travKey(
376 i,
377 () => applyValue(this.atIndex(data, i).node, data[i], ctx),
378 ctx
379 )
380 // bail out of subsequent elements in fail-fast mode (e.g. inside a
381 // union branch) so we don't traverse an element whose basis has
382 // already failed - see https://github.com/arktypeio/arktype/issues/1458
383 if (ctx.failFast && ctx.errN > errN) return
384 }
385 }
386
387 private _element: BaseRoot | undefined
388 get element(): BaseRoot {

Callers

nothing calls this directly

Calls 3

atIndexMethod · 0.95
travKeyFunction · 0.90
applyValueFunction · 0.90

Tested by

no test coverage detected