Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/zod/ZodError.ts>ZodError#flatten

TypeScript-first schema validation with static type inference
Extremely Popular
Go to Latest
method ZodError.prototype.flatten
import { ZodError } from "https://deno.land/x/zod@v3.14.3/ZodError.ts";

Parameters

optional
mapper: (issue: ZodIssue) => string

Returns

{ formErrors: string[]; fieldErrors: { [k: string]: string[]; }; }

Parameters

optional
mapper: (issue: ZodIssue) => U

Returns

{ formErrors: U[]; fieldErrors: { [k: string]: U[]; }; }

Type Parameters

optional
U = string

Parameters

optional
mapper: (issue: ZodIssue) => U = [UNSUPPORTED]

Returns

{ formErrors: U[]; fieldErrors: { [k: string]: U[]; }; }