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

Function failingValues

ark/type/checkers.ts:1277–1296  ·  view source on GitHub ↗
(
	write: WritesValues,
	held: readonly Checker[],
	withCtx?: 1,
	// 1 where it writes an array's elements, which an empty one has none of
	elements?: 1
)

Source from the content-addressed store, hash-verified

1275}
1276
1277const failingValues = (
1278 write: WritesValues,
1279 held: readonly Checker[],
1280 withCtx?: 1,
1281 // 1 where it writes an array's elements, which an empty one has none of
1282 elements?: 1
1283): Transform =>
1284 readingValues(
1285 (data, ctx) => {
1286 if (elements && !data.length) return data
1287 const values = writtenFor(ctx)
1288 try {
1289 return values.resolved(data, write(data, values))
1290 } finally {
1291 freed(values)
1292 }
1293 },
1294 held,
1295 withCtx
1296 )
1297
1298// only transforming a value Apply finds valid finds its morphs' errors
1299const applyMorphAt: ApplyAt = (ctx, checker, value, k) => {

Callers 3

transformsFailingFunction · 0.85
checkers.tsFile · 0.85
failingElementsFunction · 0.85

Calls 5

readingValuesFunction · 0.70
writtenForFunction · 0.70
writeFunction · 0.70
freedFunction · 0.70
resolvedMethod · 0.45

Tested by

no test coverage detected