MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / flattenIssue

Function flattenIssue

packages/core/src/integrations/zoderrors.ts:72–79  ·  view source on GitHub ↗
(issue: ZodIssue)

Source from the content-addressed store, hash-verified

70 * ]
71 */
72export function flattenIssue(issue: ZodIssue): SingleLevelZodIssue<ZodIssue> {
73 return {
74 ...issue,
75 path: 'path' in issue && Array.isArray(issue.path) ? issue.path.join('.') : undefined,
76 keys: 'keys' in issue ? JSON.stringify(issue.keys) : undefined,
77 unionErrors: 'unionErrors' in issue ? JSON.stringify(issue.unionErrors) : undefined,
78 };
79}
80
81/**
82 * Takes ZodError issue path array and returns a flattened version as a string.

Callers 1

zoderrrors.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected