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

Function writeCombinator

ark/type/standalone/combinators.ts:1152–1171  ·  view source on GitHub ↗
(
	js: CombinatorCompiler,
	node: BaseNode
)

Source from the content-addressed store, hash-verified

1150
1151/** a node's checker, if it combines */
1152export const writeCombinator = (
1153 js: CombinatorCompiler,
1154 node: BaseNode
1155): string | undefined => {
1156 if (!combines(node)) return
1157 const said = saidByNode.get(node)
1158 if (said) {
1159 // what it is without its message is written in place where small, and
1160 // is otherwise the unit every root that is one reads, as each field
1161 // checking a UUID reads one RegExp
1162 reachRootsOf(js, said.plain)
1163 return writeCall(
1164 "saying",
1165 readChecker(js, said.plain),
1166 JSON.stringify(said.message)
1167 )
1168 }
1169 if (node.checksCtx) return writeCall("readingCtx", writeChecker(js, node))
1170 return writeChecker(js, node)
1171}
1172
1173const writeChecker = (
1174 js: CombinatorCompiler,

Callers 2

declareTraversalsMethod · 0.90
readCheckerFunction · 0.85

Calls 6

combinesFunction · 0.85
reachRootsOfFunction · 0.85
writeCallFunction · 0.85
readCheckerFunction · 0.85
writeCheckerFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected