title: Core.z. Zod Object

A2A Node SDK - v0.1.0 / Modules / Core / z / ZodObject

Class: ZodObject<T, UnknownKeys, Catchall, Output, Input>

Core.z.ZodObject

Type parameters

NameType
Textends ZodRawShape
UnknownKeysextends UnknownKeysParam = UnknownKeysParam
Catchallextends ZodTypeAny = ZodTypeAny
OutputobjectOutputType<T, Catchall, UnknownKeys>
InputobjectInputType<T, Catchall, UnknownKeys>

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ZodObject<T, UnknownKeys, Catchall, Output, Input>(def): ZodObject<T, UnknownKeys, Catchall, Output, Input>

Type parameters

NameType
Textends ZodRawShape
UnknownKeysextends UnknownKeysParam = UnknownKeysParam
Catchallextends ZodTypeAny = ZodTypeAny
OutputobjectOutputType<T, Catchall, UnknownKeys>
InputobjectInputType<T, Catchall, UnknownKeys>

Parameters

NameType
defZodObjectDef<T, UnknownKeys, Catchall>

Returns

ZodObject<T, UnknownKeys, Catchall, Output, Input>

Inherited from

ZodType.constructor

Properties

_def

Readonly _def: ZodObjectDef<T, UnknownKeys, Catchall>

Inherited from

ZodType._def


_input

Readonly _input: Input

Inherited from

ZodType._input


_output

Readonly _output: Output

Inherited from

ZodType._output


_type

Readonly _type: Output

Inherited from

ZodType._type


augment

augment: <Augmentation>(augmentation: Augmentation) => ZodObject<extendShape<T, Augmentation>, UnknownKeys, Catchall, objectOutputType<extendShape<T, Augmentation>, Catchall, UnknownKeys>, objectInputType<extendShape<T, Augmentation>, Catchall, UnknownKeys>>

Deprecated

Use .extend instead

Type declaration

▸ <Augmentation>(augmentation): ZodObject<extendShape<T, Augmentation>, UnknownKeys, Catchall, objectOutputType<extendShape<T, Augmentation>, Catchall, UnknownKeys>, objectInputType<extendShape<T, Augmentation>, Catchall, UnknownKeys>>

Type parameters
NameType
Augmentationextends ZodRawShape
Parameters
NameType
augmentationAugmentation
Returns

ZodObject<extendShape<T, Augmentation>, UnknownKeys, Catchall, objectOutputType<extendShape<T, Augmentation>, Catchall, UnknownKeys>, objectInputType<extendShape<T, Augmentation>, Catchall, UnknownKeys>>


create

Static create: <Shape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strip", ZodTypeAny, { [k in string | number | symbol]: addQuestionMarks<baseObjectOutputType<Shape>, any>[k] }, { [k in string | number | symbol]: baseObjectInputType<Shape>[k] }>

Type declaration

▸ <Shape>(shape, params?): ZodObject<Shape, "strip", ZodTypeAny, { [k in string | number | symbol]: addQuestionMarks<baseObjectOutputType<Shape>, any>[k] }, { [k in string | number | symbol]: baseObjectInputType<Shape>[k] }>

Type parameters
NameType
Shapeextends ZodRawShape
Parameters
NameType
shapeShape
params?RawCreateParams
Returns

ZodObject<Shape, "strip", ZodTypeAny, { [k in string | number | symbol]: addQuestionMarks<baseObjectOutputType<Shape>, any>[k] }, { [k in string | number | symbol]: baseObjectInputType<Shape>[k] }>


lazycreate

Static lazycreate: <Shape>(shape: () => Shape, params?: RawCreateParams) => ZodObject<Shape, "strip", ZodTypeAny, { [k in string | number | symbol]: addQuestionMarks<baseObjectOutputType<Shape>, any>[k] }, { [k in string | number | symbol]: baseObjectInputType<Shape>[k] }>

Type declaration

▸ <Shape>(shape, params?): ZodObject<Shape, "strip", ZodTypeAny, { [k in string | number | symbol]: addQuestionMarks<baseObjectOutputType<Shape>, any>[k] }, { [k in string | number | symbol]: baseObjectInputType<Shape>[k] }>

Type parameters
NameType
Shapeextends ZodRawShape
Parameters
NameType
shape() => Shape
params?RawCreateParams
Returns

ZodObject<Shape, "strip", ZodTypeAny, { [k in string | number | symbol]: addQuestionMarks<baseObjectOutputType<Shape>, any>[k] }, { [k in string | number | symbol]: baseObjectInputType<Shape>[k] }>


nonstrict

nonstrict: () => ZodObject<T, "passthrough", Catchall, objectOutputType<T, Catchall, "passthrough">, objectInputType<T, Catchall, "passthrough">>

Deprecated

In most cases, this is no longer needed - unknown properties are now silently stripped. If you want to pass through unknown properties, use .passthrough() instead.

Type declaration

▸ (): ZodObject<T, "passthrough", Catchall, objectOutputType<T, Catchall, "passthrough">, objectInputType<T, Catchall, "passthrough">>

Returns

ZodObject<T, "passthrough", Catchall, objectOutputType<T, Catchall, "passthrough">, objectInputType<T, Catchall, "passthrough">>


spa

spa: (data: unknown, params?: InexactPartial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>

Alias of safeParseAsync

Type declaration

▸ (data, params?): Promise<SafeParseReturnType<Input, Output>>

Parameters
NameType
dataunknown
params?InexactPartial<ParseParams>
Returns

Promise<SafeParseReturnType<Input, Output>>

Inherited from

ZodType.spa


strictCreate

Static strictCreate: <Shape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strict", ZodTypeAny, { [k in string | number | symbol]: addQuestionMarks<baseObjectOutputType<Shape>, any>[k] }, { [k in string | number | symbol]: baseObjectInputType<Shape>[k] }>

Type declaration

▸ <Shape>(shape, params?): ZodObject<Shape, "strict", ZodTypeAny, { [k in string | number | symbol]: addQuestionMarks<baseObjectOutputType<Shape>, any>[k] }, { [k in string | number | symbol]: baseObjectInputType<Shape>[k] }>

Type parameters
NameType
Shapeextends ZodRawShape
Parameters
NameType
shapeShape
params?RawCreateParams
Returns

ZodObject<Shape, "strict", ZodTypeAny, { [k in string | number | symbol]: addQuestionMarks<baseObjectOutputType<Shape>, any>[k] }, { [k in string | number | symbol]: baseObjectInputType<Shape>[k] }>


~standard

~standard: Props<Input, Output>

Inherited from

ZodType.~standard

Accessors

description

get description(): undefined | string

Returns

undefined | string

Inherited from

ZodType.description


shape

get shape(): T

Returns

T

Methods

_getCached

_getCached(): Object

Returns

Object

NameType
keysstring[]
shapeT

_getOrReturnCtx

_getOrReturnCtx(input, ctx?): ParseContext

Parameters

NameType
inputParseInput
ctx?ParseContext

Returns

ParseContext

Inherited from

ZodType._getOrReturnCtx


_getType

_getType(input): string

Parameters

NameType
inputParseInput

Returns

string

Inherited from

ZodType._getType


_parse

_parse(input): ParseReturnType<Output>

Parameters

NameType
inputParseInput

Returns

ParseReturnType<Output>

Overrides

ZodType._parse


_parseAsync

_parseAsync(input): AsyncParseReturnType<Output>

Parameters

NameType
inputParseInput

Returns

AsyncParseReturnType<Output>

Inherited from

ZodType._parseAsync


_parseSync

_parseSync(input): SyncParseReturnType<Output>

Parameters

NameType
inputParseInput

Returns

SyncParseReturnType<Output>

Inherited from

ZodType._parseSync


_processInputParams

_processInputParams(input): Object

Parameters

NameType
inputParseInput

Returns

Object

NameType
ctxParseContext
statusParseStatus

Inherited from

ZodType._processInputParams


_refinement

_refinement(refinement): ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, Output, Input>

Parameters

NameType
refinement(arg: Output, ctx: RefinementCtx) => any

Returns

ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, Output, Input>

Inherited from

ZodType._refinement


and

and<T>(incoming): ZodIntersection<ZodObject<T, UnknownKeys, Catchall, Output, Input>, T>

Type parameters

NameType
Textends ZodTypeAny

Parameters

NameType
incomingT

Returns

ZodIntersection<ZodObject<T, UnknownKeys, Catchall, Output, Input>, T>

Inherited from

ZodType.and


array

array(): ZodArray<ZodObject<T, UnknownKeys, Catchall, Output, Input>, "many">

Returns

ZodArray<ZodObject<T, UnknownKeys, Catchall, Output, Input>, "many">

Inherited from

ZodType.array


brand

brand<B>(brand?): ZodBranded<ZodObject<T, UnknownKeys, Catchall, Output, Input>, B>

Type parameters

NameType
Bextends string | number | symbol

Parameters

NameType
brand?B

Returns

ZodBranded<ZodObject<T, UnknownKeys, Catchall, Output, Input>, B>

Inherited from

ZodType.brand


catch

catch(def): ZodCatch<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Parameters

NameType
defOutput

Returns

ZodCatch<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Inherited from

ZodType.catch

catch(def): ZodCatch<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Parameters

NameType
def(ctx: { error: ZodError<any> ; input: Input }) => Output

Returns

ZodCatch<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Inherited from

ZodType.catch


catchall

catchall<Index>(index): ZodObject<T, UnknownKeys, Index, objectOutputType<T, Index, UnknownKeys>, objectInputType<T, Index, UnknownKeys>>

Type parameters

NameType
Indexextends ZodTypeAny

Parameters

NameType
indexIndex

Returns

ZodObject<T, UnknownKeys, Index, objectOutputType<T, Index, UnknownKeys>, objectInputType<T, Index, UnknownKeys>>


deepPartial

deepPartial(): DeepPartial<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Returns

DeepPartial<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Deprecated


default

default(def): ZodDefault<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Parameters

NameType
defnoUndefined<Input>

Returns

ZodDefault<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Inherited from

ZodType.default

default(def): ZodDefault<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Parameters

NameType
def() => noUndefined<Input>

Returns

ZodDefault<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Inherited from

ZodType.default


describe

describe(description): this

Parameters

NameType
descriptionstring

Returns

this

Inherited from

ZodType.describe


extend

extend<Augmentation>(augmentation): ZodObject<extendShape<T, Augmentation>, UnknownKeys, Catchall, objectOutputType<extendShape<T, Augmentation>, Catchall, UnknownKeys>, objectInputType<extendShape<T, Augmentation>, Catchall, UnknownKeys>>

Type parameters

NameType
Augmentationextends ZodRawShape

Parameters

NameType
augmentationAugmentation

Returns

ZodObject<extendShape<T, Augmentation>, UnknownKeys, Catchall, objectOutputType<extendShape<T, Augmentation>, Catchall, UnknownKeys>, objectInputType<extendShape<T, Augmentation>, Catchall, UnknownKeys>>


isNullable

isNullable(): boolean

Returns

boolean

Inherited from

ZodType.isNullable


isOptional

isOptional(): boolean

Returns

boolean

Inherited from

ZodType.isOptional


keyof

keyof(): ZodEnum<CastToStringTuple<UnionToTuple<keyof T, []>>>

Returns

ZodEnum<CastToStringTuple<UnionToTuple<keyof T, []>>>


merge

merge<Incoming, Augmentation>(merging): ZodObject<extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"], objectOutputType<extendShape<T, Augmentation>, Incoming["_def"]["catchall"], Incoming["_def"]["unknownKeys"]>, objectInputType<extendShape<T, Augmentation>, Incoming["_def"]["catchall"], Incoming["_def"]["unknownKeys"]>>

Prior to zod@1.0.12 there was a bug in the inferred type of merged objects. Please upgrade if you are experiencing issues.

Type parameters

NameType
Incomingextends AnyZodObject
Augmentationextends any

Parameters

NameType
mergingIncoming

Returns

ZodObject<extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"], objectOutputType<extendShape<T, Augmentation>, Incoming["_def"]["catchall"], Incoming["_def"]["unknownKeys"]>, objectInputType<extendShape<T, Augmentation>, Incoming["_def"]["catchall"], Incoming["_def"]["unknownKeys"]>>


nullable

nullable(): ZodNullable<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Returns

ZodNullable<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Inherited from

ZodType.nullable


nullish

nullish(): ZodOptional<ZodNullable<ZodObject<T, UnknownKeys, Catchall, Output, Input>>>

Returns

ZodOptional<ZodNullable<ZodObject<T, UnknownKeys, Catchall, Output, Input>>>

Inherited from

ZodType.nullish


omit

omit<Mask>(mask): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall, objectOutputType<Omit<T, keyof Mask>, Catchall, UnknownKeys>, objectInputType<Omit<T, keyof Mask>, Catchall, UnknownKeys>>

Type parameters

NameType
Maskextends Exactly<{ [k in string | number | symbol]?: true }, Mask>

Parameters

NameType
maskMask

Returns

ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall, objectOutputType<Omit<T, keyof Mask>, Catchall, UnknownKeys>, objectInputType<Omit<T, keyof Mask>, Catchall, UnknownKeys>>


optional

optional(): ZodOptional<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Returns

ZodOptional<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Inherited from

ZodType.optional


or

or<T>(option): ZodUnion<[ZodObject<T, UnknownKeys, Catchall, Output, Input>, T]>

Type parameters

NameType
Textends ZodTypeAny

Parameters

NameType
optionT

Returns

ZodUnion<[ZodObject<T, UnknownKeys, Catchall, Output, Input>, T]>

Inherited from

ZodType.or


parse

parse(data, params?): Output

Parameters

NameType
dataunknown
params?InexactPartial<ParseParams>

Returns

Output

Inherited from

ZodType.parse


parseAsync

parseAsync(data, params?): Promise<Output>

Parameters

NameType
dataunknown
params?InexactPartial<ParseParams>

Returns

Promise<Output>

Inherited from

ZodType.parseAsync


partial

partial(): ZodObject<{ [k in string | number | symbol]: ZodOptional<T[k]> }, UnknownKeys, Catchall, objectOutputType<{ [k in string | number | symbol]: ZodOptional<T[k]> }, Catchall, UnknownKeys>, objectInputType<{ [k in string | number | symbol]: ZodOptional<T[k]> }, Catchall, UnknownKeys>>

Returns

ZodObject<{ [k in string | number | symbol]: ZodOptional<T[k]> }, UnknownKeys, Catchall, objectOutputType<{ [k in string | number | symbol]: ZodOptional<T[k]> }, Catchall, UnknownKeys>, objectInputType<{ [k in string | number | symbol]: ZodOptional<T[k]> }, Catchall, UnknownKeys>>

partial<Mask>(mask): ZodObject<{ [k in string | number | symbol]: k extends keyof T ? { [k in string | number | symbol]: k extends keyof Mask ? ZodOptional<T[k<k>]> : T[k] }[k<k>] : never }, UnknownKeys, Catchall, objectOutputType<{ [k in string | number | symbol]: k extends keyof T ? { [k in string | number | symbol]: k extends keyof Mask ? ZodOptional<T[k<k>]> : T[k] }[k<k>] : never }, Catchall, UnknownKeys>, objectInputType<{ [k in string | number | symbol]: k extends keyof T ? { [k in string | number | symbol]: k extends keyof Mask ? ZodOptional<T[k<k>]> : T[k] }[k<k>] : never }, Catchall, UnknownKeys>>

Type parameters

NameType
Maskextends Exactly<{ [k in string | number | symbol]?: true }, Mask>

Parameters

NameType
maskMask

Returns

ZodObject<{ [k in string | number | symbol]: k extends keyof T ? { [k in string | number | symbol]: k extends keyof Mask ? ZodOptional<T[k<k>]> : T[k] }[k<k>] : never }, UnknownKeys, Catchall, objectOutputType<{ [k in string | number | symbol]: k extends keyof T ? { [k in string | number | symbol]: k extends keyof Mask ? ZodOptional<T[k<k>]> : T[k] }[k<k>] : never }, Catchall, UnknownKeys>, objectInputType<{ [k in string | number | symbol]: k extends keyof T ? { [k in string | number | symbol]: k extends keyof Mask ? ZodOptional<T[k<k>]> : T[k] }[k<k>] : never }, Catchall, UnknownKeys>>


passthrough

passthrough(): ZodObject<T, "passthrough", Catchall, objectOutputType<T, Catchall, "passthrough">, objectInputType<T, Catchall, "passthrough">>

Returns

ZodObject<T, "passthrough", Catchall, objectOutputType<T, Catchall, "passthrough">, objectInputType<T, Catchall, "passthrough">>


pick

pick<Mask>(mask): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall, objectOutputType<Pick<T, Extract<keyof T, keyof Mask>>, Catchall, UnknownKeys>, objectInputType<Pick<T, Extract<keyof T, keyof Mask>>, Catchall, UnknownKeys>>

Type parameters

NameType
Maskextends Exactly<{ [k in string | number | symbol]?: true }, Mask>

Parameters

NameType
maskMask

Returns

ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall, objectOutputType<Pick<T, Extract<keyof T, keyof Mask>>, Catchall, UnknownKeys>, objectInputType<Pick<T, Extract<keyof T, keyof Mask>>, Catchall, UnknownKeys>>


pipe

pipe<T>(target): ZodPipeline<ZodObject<T, UnknownKeys, Catchall, Output, Input>, T>

Type parameters

NameType
Textends ZodTypeAny

Parameters

NameType
targetT

Returns

ZodPipeline<ZodObject<T, UnknownKeys, Catchall, Output, Input>, T>

Inherited from

ZodType.pipe


promise

promise(): ZodPromise<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Returns

ZodPromise<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Inherited from

ZodType.promise


readonly

readonly(): ZodReadonly<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Returns

ZodReadonly<ZodObject<T, UnknownKeys, Catchall, Output, Input>>

Inherited from

ZodType.readonly


refine

refine<RefinedOutput>(check, message?): ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, RefinedOutput, Input>

Type parameters

Name
RefinedOutput

Parameters

NameType
check(arg: Output) => arg is RefinedOutput
message?string | Partial<Omit<ZodCustomIssue, "code">> | (arg: Output) => Partial<Omit<ZodCustomIssue, "code">>

Returns

ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, RefinedOutput, Input>

Inherited from

ZodType.refine

refine(check, message?): ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, Output, Input>

Parameters

NameType
check(arg: Output) => unknown
message?string | Partial<Omit<ZodCustomIssue, "code">> | (arg: Output) => Partial<Omit<ZodCustomIssue, "code">>

Returns

ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, Output, Input>

Inherited from

ZodType.refine


refinement

refinement<RefinedOutput>(check, refinementData): ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, RefinedOutput, Input>

Type parameters

Name
RefinedOutput

Parameters

NameType
check(arg: Output) => arg is RefinedOutput
refinementDataIssueData | (arg: Output, ctx: RefinementCtx) => IssueData

Returns

ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, RefinedOutput, Input>

Inherited from

ZodType.refinement

refinement(check, refinementData): ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, Output, Input>

Parameters

NameType
check(arg: Output) => boolean
refinementDataIssueData | (arg: Output, ctx: RefinementCtx) => IssueData

Returns

ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, Output, Input>

Inherited from

ZodType.refinement


required

required(): ZodObject<{ [k in string | number | symbol]: deoptional<T[k]> }, UnknownKeys, Catchall, objectOutputType<{ [k in string | number | symbol]: deoptional<T[k]> }, Catchall, UnknownKeys>, objectInputType<{ [k in string | number | symbol]: deoptional<T[k]> }, Catchall, UnknownKeys>>

Returns

ZodObject<{ [k in string | number | symbol]: deoptional<T[k]> }, UnknownKeys, Catchall, objectOutputType<{ [k in string | number | symbol]: deoptional<T[k]> }, Catchall, UnknownKeys>, objectInputType<{ [k in string | number | symbol]: deoptional<T[k]> }, Catchall, UnknownKeys>>

required<Mask>(mask): ZodObject<{ [k in string | number | symbol]: k extends keyof T ? { [k in string | number | symbol]: k extends keyof Mask ? deoptional<T[k<k>]> : T[k] }[k<k>] : never }, UnknownKeys, Catchall, objectOutputType<{ [k in string | number | symbol]: k extends keyof T ? { [k in string | number | symbol]: k extends keyof Mask ? deoptional<T[k<k>]> : T[k] }[k<k>] : never }, Catchall, UnknownKeys>, objectInputType<{ [k in string | number | symbol]: k extends keyof T ? { [k in string | number | symbol]: k extends keyof Mask ? deoptional<T[k<k>]> : T[k] }[k<k>] : never }, Catchall, UnknownKeys>>

Type parameters

NameType
Maskextends Exactly<{ [k in string | number | symbol]?: true }, Mask>

Parameters

NameType
maskMask

Returns

ZodObject<{ [k in string | number | symbol]: k extends keyof T ? { [k in string | number | symbol]: k extends keyof Mask ? deoptional<T[k<k>]> : T[k] }[k<k>] : never }, UnknownKeys, Catchall, objectOutputType<{ [k in string | number | symbol]: k extends keyof T ? { [k in string | number | symbol]: k extends keyof Mask ? deoptional<T[k<k>]> : T[k] }[k<k>] : never }, Catchall, UnknownKeys>, objectInputType<{ [k in string | number | symbol]: k extends keyof T ? { [k in string | number | symbol]: k extends keyof Mask ? deoptional<T[k<k>]> : T[k] }[k<k>] : never }, Catchall, UnknownKeys>>


safeParse

safeParse(data, params?): SafeParseReturnType<Input, Output>

Parameters

NameType
dataunknown
params?InexactPartial<ParseParams>

Returns

SafeParseReturnType<Input, Output>

Inherited from

ZodType.safeParse


safeParseAsync

safeParseAsync(data, params?): Promise<SafeParseReturnType<Input, Output>>

Parameters

NameType
dataunknown
params?InexactPartial<ParseParams>

Returns

Promise<SafeParseReturnType<Input, Output>>

Inherited from

ZodType.safeParseAsync


setKey

setKey<Key, Schema>(key, schema): ZodObject<T & { [k in string]: Schema }, UnknownKeys, Catchall, objectOutputType<T & { [k in string]: Schema }, Catchall, UnknownKeys>, objectInputType<T & { [k in string]: Schema }, Catchall, UnknownKeys>>

Type parameters

NameType
Keyextends string
Schemaextends ZodTypeAny

Parameters

NameType
keyKey
schemaSchema

Returns

ZodObject<T & { [k in string]: Schema }, UnknownKeys, Catchall, objectOutputType<T & { [k in string]: Schema }, Catchall, UnknownKeys>, objectInputType<T & { [k in string]: Schema }, Catchall, UnknownKeys>>


strict

strict(message?): ZodObject<T, "strict", Catchall, objectOutputType<T, Catchall, "strict">, objectInputType<T, Catchall, "strict">>

Parameters

NameType
message?ErrMessage

Returns

ZodObject<T, "strict", Catchall, objectOutputType<T, Catchall, "strict">, objectInputType<T, Catchall, "strict">>


strip

strip(): ZodObject<T, "strip", Catchall, objectOutputType<T, Catchall, "strip">, objectInputType<T, Catchall, "strip">>

Returns

ZodObject<T, "strip", Catchall, objectOutputType<T, Catchall, "strip">, objectInputType<T, Catchall, "strip">>


superRefine

superRefine<RefinedOutput>(refinement): ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, RefinedOutput, Input>

Type parameters

Name
RefinedOutput

Parameters

NameType
refinement(arg: Output, ctx: RefinementCtx) => arg is RefinedOutput

Returns

ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, RefinedOutput, Input>

Inherited from

ZodType.superRefine

superRefine(refinement): ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, Output, Input>

Parameters

NameType
refinement(arg: Output, ctx: RefinementCtx) => void

Returns

ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, Output, Input>

Inherited from

ZodType.superRefine

superRefine(refinement): ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, Output, Input>

Parameters

NameType
refinement(arg: Output, ctx: RefinementCtx) => Promise<void>

Returns

ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, Output, Input>

Inherited from

ZodType.superRefine


transform

transform<NewOut>(transform): ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, NewOut, Input>

Type parameters

Name
NewOut

Parameters

NameType
transform(arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>

Returns

ZodEffects<ZodObject<T, UnknownKeys, Catchall, Output, Input>, NewOut, Input>

Inherited from

ZodType.transform


~validate

~validate(data): Result<Output> | Promise<Result<Output>>

Parameters

NameType
dataunknown

Returns

Result<Output> | Promise<Result<Output>>

Inherited from

ZodType.~validate