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

Function writeRootApply

ark/schema/shared/rootApply.ts:38–41  ·  view source on GitHub ↗
(node: BaseRoot, name: string)

Source from the content-addressed store, hash-verified

36
37// name keys the root's resolution, so it must be what its unit names it
38export const writeRootApply = (node: BaseRoot, name: string): string => {
39 const [reads, rootApply, applyFailed] = rootApplyParts(node, name)
40 return `"use strict"\nconst ${reads.join(", ")}\n${applyFailed ? `const applyFailed = ${applyFailed}\n` : ""}return (${rootApply})`
41}
42
43// the node members a root apply reads, as `member = node.member`, its function
44// and the one its failure path is. An artifact's reads its name from the node,

Callers 1

compileRootApplyFunction · 0.90

Calls 1

rootApplyPartsFunction · 0.85

Tested by

no test coverage detected