Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/zod/mod.ts>ZodError

TypeScript-first schema validation with static type inference
Very Popular
Go to Latest
class ZodError
extends Error
Re-export
import { ZodError } from "https://deno.land/x/zod@v3.17.3/mod.ts";

Constructors

new
ZodError(issues: ZodIssue[])

Type Parameters

optional
T = any

Properties

addIssue: (sub: ZodIssue) => unknown
addIssues: (subs?: ZodIssue[]) => unknown
readonly
errors
readonly
formErrors
readonly
isEmpty: boolean
issues: ZodIssue[]
readonly
message

Methods

flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>
flatten<U = string>(mapper?: (issue: ZodIssue) => U): any
format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>
format(_mapper?: any)

Static Properties

create: (issues: ZodIssue[]) => unknown