( errors: ReadableErrors<issue> )
| 22 | * The first error at each path, by the string of the path. |
| 23 | */ |
| 24 | export const byPath = <issue extends PathedIssue>( |
| 25 | errors: ReadableErrors<issue> |
| 26 | ): Record<string, issue> => { |
| 27 | const result: Record<string, issue> = {} |
| 28 | for (const error of errors.issues) { |
| 29 | const k = propStringOf(error) |
| 30 | if (!hasOwn(result, k)) defineEntry(result, k, error) |
| 31 | } |
| 32 | return result |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Each path's errors, by the string of the path. |
no test coverage detected