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

Function validator

ark/aot/shadow.ts:268–279  ·  view source on GitHub ↗
(...path: string[])

Source from the content-addressed store, hash-verified

266 const isWritten = inArktype(() => pair.original.tfs)
267 const validator =
268 (...path: string[]) =>
269 (data: unknown) =>
270 validateBoth(
271 pair,
272 path.join(".") || "call",
273 data,
274 { isWritten: path[0] !== "allows" && isWritten },
275 (t, data) =>
276 path[0] === "~standard" ? asErrors(readAt(t, path, [data]))
277 : path.length ? readAt(t, path, [data])
278 : t(data)
279 )
280 const introspector =
281 (...path: string[]) =>
282 (...args: unknown[]) =>

Callers 8

memberOfFunction · 0.70
typeHandlerOfFunction · 0.70
outcomeOfFunction · 0.50
failureOfFunction · 0.50
standalone.test.tsFile · 0.50
returnsForeignErrorsFunction · 0.50
standardValidatedFunction · 0.50
runtime.tsFile · 0.50

Calls 4

validateBothFunction · 0.85
asErrorsFunction · 0.85
readAtFunction · 0.85
tFunction · 0.85

Tested by 3

outcomeOfFunction · 0.40
failureOfFunction · 0.40
returnsForeignErrorsFunction · 0.40