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

Function flatByPath

ark/schema/shared/errorReaders.ts:38–45  ·  view source on GitHub ↗
(
	errors: ReadableErrors<issue>
)

Source from the content-addressed store, hash-verified

36 * Each path's errors, by the string of the path.
37 */
38export const flatByPath = <issue extends PathedIssue>(
39 errors: ReadableErrors<issue>
40): Record<string, issue[]> => {
41 const result: Record<string, issue[]> = {}
42 for (const error of errors.issues)
43 addEntry(result, propStringOf(error), error)
44 return result
45}
46
47/**
48 * Each path's messages, by the string of the path.

Callers 2

errors.test.tsFile · 0.90
traverse.test.tsFile · 0.85

Calls 2

addEntryFunction · 0.85
propStringOfFunction · 0.85

Tested by

no test coverage detected