import { ZodSchema } from "https://deno.land/x/zod@v3.9.8/index.ts";
Constructors
new
ZodSchema(def: Def)Properties
readonly
_def: Defreadonly
_input: Inputreadonly
_output: Outputreadonly
_type: OutputThe .check method has been removed in Zod 3. For details see https://github.com/colinhacks/zod/tree/v3.
The .is method has been removed in Zod 3. For details see https://github.com/colinhacks/zod/tree/v3.
Methods
abstract
_parse(): ParseReturnType<Output>_refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this>
addIssue()
and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>
default(def: util.noUndefined<Input>): ZodDefault<this>
default(def: () => util.noUndefined<Input>): ZodDefault<this>
default(def: any)
isNullable(): boolean
isOptional(): boolean
nullable(): ZodNullable<this>
nullish(): ZodNullable<ZodOptional<this>>
optional(): ZodOptional<this>
or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>
parse(data: unknown, params?: Partial<ParseParamsNoData>): Output
parseAsync(data: unknown, params?: Partial<ParseParamsNoData>): Promise<Output>
promise(): ZodPromise<this>
refine<Func extends (arg: Output) => any>(check: Func, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this>
refinement(check: (arg: Output) => any, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this>
safeParse(data: unknown, params?: Partial<ParseParamsNoData>): { success: true; data: Output; } | { success: false; error: ZodError<Input>; }
safeParseAsync(data: unknown, params?: Partial<ParseParamsNoData>): Promise<{ success: true; data: Output; } | { success: false; error: ZodError; }>
transform<NewOut>(transform: (arg: Output) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>