import { z } from "https://deno.land/x/zod@v3.20.3/mod.ts";
const { ZodObject } = z;
Type Parameters
T extends ZodRawShape
UnknownKeys extends UnknownKeysParam
optional
Catchall extends ZodTypeAny = ZodTypeAnyoptional
Output = objectOutputType<T, Catchall>optional
Input = objectInputType<T, Catchall>Methods
_getCached(): { shape: T; keys: string[]; }
_parse(input: ParseInput): ParseReturnType<this["_output"]>
catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>
deepPartial(): partialUtil.DeepPartial<this>
merge<Incoming extends AnyZodObject>(merging: Incoming): ZodObject<extendShape<T, ReturnType<Incoming["_def"]["shape"]>>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>
Prior to zod@1.0.12 there was a bug in the inferred type of merged objects. Please upgrade if you are experiencing issues.
omit<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, objectKeyMask<T>>): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>
partial(): ZodObject<[k in keyof T]: ZodOptional<T[k]>, UnknownKeys, Catchall>
partial<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, objectKeyMask<T>>): ZodObject<objectUtil.noNever<[k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k]>, UnknownKeys, Catchall>
passthrough(): ZodObject<T, "passthrough", Catchall>
pick<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, T>): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>
required(): ZodObject<[k in keyof T]: deoptional<T[k]>, UnknownKeys, Catchall>
required<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, objectKeyMask<T>>): ZodObject<objectUtil.noNever<[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k]>, UnknownKeys, Catchall>
setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & [k in Key]: Schema, UnknownKeys, Catchall>
Static Properties
create: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strip">
lazycreate: <T extends ZodRawShape>(shape: () => T, params?: RawCreateParams) => ZodObject<T, "strip">
strictCreate: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strict">