We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0abcc0 commit 62bf4e4Copy full SHA for 62bf4e4
packages/zod/src/v3/ZodError.ts
@@ -296,7 +296,7 @@ export class ZodError<T = any> extends Error {
296
flatten(): typeToFlattenedError<T>;
297
flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
298
flatten<U = string>(mapper: (issue: ZodIssue) => U = (issue: ZodIssue) => issue.message as any): any {
299
- const fieldErrors: any = {};
+ const fieldErrors: any = Object.create(null);
300
const formErrors: U[] = [];
301
for (const sub of this.issues) {
302
if (sub.path.length > 0) {
0 commit comments