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

Function validator

ark/aot/settingsValidators.ts:1221–1228  ·  view source on GitHub ↗
(data, pipedFromCtx, onFail)

Source from the content-addressed store, hash-verified

1219})(intersectionj0sv370oqte88)
1220var create1q5hta0h0lh5t = ([allows], id, holes = []) => {
1221 const validator = (data, pipedFromCtx, onFail) =>
1222 allows(data) ?
1223 (allows.t?.(data) ?? data)
1224 : foundErrors(
1225 allows,
1226 data,
1227 pipedFromCtx ? errors => pipedFromCtx.piped(errors) : onFail
1228 )
1229 validator.allows = freeze(allows)
1230 validator.withContext = freeze(context => withContextOf2(validator, context))
1231 return holdHoles(freeze(validator), id, holes)

Callers

nothing calls this directly

Calls 3

pipedMethod · 0.80
foundErrorsFunction · 0.70
allowsFunction · 0.50

Tested by

no test coverage detected