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

Function writeChecker

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

Source from the content-addressed store, hash-verified

1171}
1172
1173const writeChecker = (
1174 js: CombinatorCompiler,
1175 node: BaseNode
1176): string | undefined => {
1177 if (node.is("domain") || node.is("proto")) return writeCheck(js, node)
1178 if (node.is("unit")) {
1179 return writeCall(
1180 "unit",
1181 writeLiteral(js, node.unit),
1182 unlessDerived(runtime.describeValues([node.unit]), unitSiteOf(node)!)
1183 )
1184 }
1185 if (node.is("morph")) return writeMorph(js, node)
1186 if (node.is("intersection")) return writeIntersectionCombinator(js, node)
1187 if (node.is("union")) return writeUnionCombinator(js, node)
1188}
1189
1190// a callback is read where it's called, as it may be set once this has loaded
1191const writeMorph = (js: CombinatorCompiler, node: MorphNode): string =>

Callers 1

writeCombinatorFunction · 0.85

Calls 9

writeCheckFunction · 0.85
writeCallFunction · 0.85
writeLiteralFunction · 0.85
unlessDerivedFunction · 0.85
unitSiteOfFunction · 0.85
writeMorphFunction · 0.85
writeUnionCombinatorFunction · 0.85
isMethod · 0.80

Tested by

no test coverage detected