(path: Array<string | number>)
| 91 | * flattenIssuePath([0, 'foo', 1, 'bar']) // -> '<array>.foo.<array>.bar' |
| 92 | */ |
| 93 | export function flattenIssuePath(path: Array<string | number>): string { |
| 94 | return path |
| 95 | .map(p => { |
| 96 | if (typeof p === 'number') { |
| 97 | return '<array>'; |
| 98 | } else { |
| 99 | return p; |
| 100 | } |
| 101 | }) |
| 102 | .join('.'); |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * Zod error message is a stringified version of ZodError.issues |
no outgoing calls
no test coverage detected