Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/zod/mod.ts>ZodError#flatten

TypeScript-first schema validation with static type inference
Extremely Popular
Go to Latest
method ZodError.prototype.flatten
Re-export
import { ZodError } from "https://deno.land/x/zod@v3.14.2/mod.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[]; }; }