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

Method compile

ark/schema/structure/sequence.ts:425–436  ·  view source on GitHub ↗
(js: NodeCompiler)

Source from the content-addressed store, hash-verified

423
424 // minLength/maxLength compilation should be handled by Intersection
425 compile(js: NodeCompiler): void {
426 if (js.trav === "Transform") return this.jsTf(js)
427 // like Structure, bail out of subsequent elements in fail-fast mode
428 // (e.g. inside a union branch) so we don't traverse an element whose
429 // basis has already failed - see
430 // https://github.com/arktypeio/arktype/issues/1458
431 this.jsElements(js, (keyExpr, node) =>
432 js.travKey(keyExpr, `data[${keyExpr}]`, node)
433 )
434
435 js.return(true)
436 }
437
438 private jsTf(js: NodeCompiler): void {
439 js.initTf(this.children).let("out", "data")

Callers

nothing calls this directly

Calls 3

jsTfMethod · 0.95
jsElementsMethod · 0.95
returnMethod · 0.80

Tested by

no test coverage detected