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

Function writeHeld

ark/type/standalone/combinators.ts:709–717  ·  view source on GitHub ↗
(prop: Prop.Node, i: number, failing: boolean)

Source from the content-addressed store, hash-verified

707
708// what a key reads through its checker's transform, where it has one
709const writeHeld = (prop: Prop.Node, i: number, failing: boolean): string => {
710 const read = `data${writeAccess(prop.key as string)}`
711 return (
712 !prop.value.tfs ? read
713 : failing ?
714 `values.transformed(checkers[${i}].t, ${read}, ${JSON.stringify(prop.key)})`
715 : `checkers[${i}].t(${read})`
716 )
717}
718
719// whether a key a default writes holds a value
720const writeHolds = (prop: Prop.Node): string =>

Callers 2

writeSitedWriteFunction · 0.85
writeSitedKeepFunction · 0.85

Calls 1

writeAccessFunction · 0.85

Tested by

no test coverage detected