title: Core.z. Zod Catch
A2A Node SDK - v0.1.0 / Modules / Core / z / ZodCatch
Class: ZodCatch<T>
Type parameters
Name | Type |
---|---|
T | extends ZodTypeAny |
Hierarchy
-
ZodType
<T
["_output"
],ZodCatchDef
<T
>,unknown
>↳
ZodCatch
Table of contents
Constructors
Properties
Accessors
Methods
- _getOrReturnCtx
- _getType
- _parse
- _parseAsync
- _parseSync
- _processInputParams
- _refinement
- and
- array
- brand
- catch
- default
- describe
- isNullable
- isOptional
- nullable
- nullish
- optional
- or
- parse
- parseAsync
- pipe
- promise
- readonly
- refine
- refinement
- removeCatch
- safeParse
- safeParseAsync
- superRefine
- transform
- ~validate
Constructors
constructor
• new ZodCatch<T
>(def
): ZodCatch
<T
>
Type parameters
Name | Type |
---|---|
T | extends ZodTypeAny |
Parameters
Name | Type |
---|---|
def | ZodCatchDef <T > |
Returns
ZodCatch
<T
>
Inherited from
Properties
_def
• Readonly
_def: ZodCatchDef
<T
>
Inherited from
_input
• Readonly
_input: unknown
Inherited from
_output
• Readonly
_output: T
["_output"
]
Inherited from
_type
• Readonly
_type: T
["_output"
]
Inherited from
create
▪ Static
create: <Inner>(type
: Inner
, params
: { description?
: string
; errorMap?
: ZodErrorMap
; invalid_type_error?
: string
; message?
: string
; required_error?
: string
} & { catch
: Inner
["_output"
] | () => Inner
["_output"
] }) => ZodCatch
<Inner
>
Type declaration
▸ <Inner
>(type
, params
): ZodCatch
<Inner
>
Type parameters
Name | Type |
---|---|
Inner | extends ZodTypeAny |
Parameters
Name | Type |
---|---|
type | Inner |
params | { description? : string ; errorMap? : ZodErrorMap ; invalid_type_error? : string ; message? : string ; required_error? : string } & { catch : Inner ["_output" ] | () => Inner ["_output" ] } |
Returns
ZodCatch
<Inner
>
spa
• spa: (data
: unknown
, params?
: InexactPartial
<ParseParams
>) => Promise
<SafeParseReturnType
<unknown
, T
["_output"
]>>
Alias of safeParseAsync
Type declaration
▸ (data
, params?
): Promise
<SafeParseReturnType
<unknown
, T
["_output"
]>>
Parameters
Name | Type |
---|---|
data | unknown |
params? | InexactPartial <ParseParams > |
Returns
Promise
<SafeParseReturnType
<unknown
, T
["_output"
]>>
Inherited from
~standard
• ~standard: Props
<unknown
, T
["_output"
]>
Inherited from
Accessors
description
• get
description(): undefined
| string
Returns
undefined
| string
Inherited from
ZodType.description
Methods
_getOrReturnCtx
▸ _getOrReturnCtx(input
, ctx?
): ParseContext
Parameters
Name | Type |
---|---|
input | ParseInput |
ctx? | ParseContext |
Returns
Inherited from
_getType
▸ _getType(input
): string
Parameters
Name | Type |
---|---|
input | ParseInput |
Returns
string
Inherited from
_parse
▸ _parse(input
): ParseReturnType
<T
["_output"
]>
Parameters
Name | Type |
---|---|
input | ParseInput |
Returns
ParseReturnType
<T
["_output"
]>
Overrides
_parseAsync
▸ _parseAsync(input
): AsyncParseReturnType
<T
["_output"
]>
Parameters
Name | Type |
---|---|
input | ParseInput |
Returns
AsyncParseReturnType
<T
["_output"
]>
Inherited from
_parseSync
▸ _parseSync(input
): SyncParseReturnType
<T
["_output"
]>
Parameters
Name | Type |
---|---|
input | ParseInput |
Returns
SyncParseReturnType
<T
["_output"
]>
Inherited from
_processInputParams
▸ _processInputParams(input
): Object
Parameters
Name | Type |
---|---|
input | ParseInput |
Returns
Object
Name | Type |
---|---|
ctx | ParseContext |
status | ParseStatus |
Inherited from
_refinement
▸ _refinement(refinement
): ZodEffects
<ZodCatch
<T
>, T
["_output"
], unknown
>
Parameters
Name | Type |
---|---|
refinement | (arg : T ["_output" ], ctx : RefinementCtx ) => any |
Returns
ZodEffects
<ZodCatch
<T
>, T
["_output"
], unknown
>
Inherited from
and
▸ and<T
>(incoming
): ZodIntersection
<ZodCatch
<T
>, T
>
Type parameters
Name | Type |
---|---|
T | extends ZodTypeAny |
Parameters
Name | Type |
---|---|
incoming | T |
Returns
ZodIntersection
<ZodCatch
<T
>, T
>
Inherited from
array
▸ array(): ZodArray
<ZodCatch
<T
>, "many"
>
Returns
Inherited from
brand
▸ brand<B
>(brand?
): ZodBranded
<ZodCatch
<T
>, B
>
Type parameters
Name | Type |
---|---|
B | extends string | number | symbol |
Parameters
Name | Type |
---|---|
brand? | B |
Returns
ZodBranded
<ZodCatch
<T
>, B
>
Inherited from
catch
▸ catch(def
): ZodCatch
<ZodCatch
<T
>>
Parameters
Name | Type |
---|---|
def | T ["_output" ] |
Returns
Inherited from
▸ catch(def
): ZodCatch
<ZodCatch
<T
>>
Parameters
Name | Type |
---|---|
def | (ctx : { error : ZodError <any > ; input : unknown }) => T ["_output" ] |
Returns
Inherited from
default
▸ default(def
): ZodDefault
<ZodCatch
<T
>>
Parameters
Name | Type |
---|---|
def | unknown |
Returns
ZodDefault
<ZodCatch
<T
>>
Inherited from
▸ default(def
): ZodDefault
<ZodCatch
<T
>>
Parameters
Name | Type |
---|---|
def | () => unknown |
Returns
ZodDefault
<ZodCatch
<T
>>
Inherited from
describe
▸ describe(description
): this
Parameters
Name | Type |
---|---|
description | string |
Returns
this
Inherited from
isNullable
▸ isNullable(): boolean
Returns
boolean
Inherited from
isOptional
▸ isOptional(): boolean
Returns
boolean
Inherited from
nullable
▸ nullable(): ZodNullable
<ZodCatch
<T
>>
Returns
ZodNullable
<ZodCatch
<T
>>
Inherited from
nullish
▸ nullish(): ZodOptional
<ZodNullable
<ZodCatch
<T
>>>
Returns
ZodOptional
<ZodNullable
<ZodCatch
<T
>>>
Inherited from
optional
▸ optional(): ZodOptional
<ZodCatch
<T
>>
Returns
ZodOptional
<ZodCatch
<T
>>
Inherited from
or
▸ or<T
>(option
): ZodUnion
<[ZodCatch
<T
>, T
]>
Type parameters
Name | Type |
---|---|
T | extends ZodTypeAny |
Parameters
Name | Type |
---|---|
option | T |
Returns
Inherited from
parse
▸ parse(data
, params?
): T
["_output"
]
Parameters
Name | Type |
---|---|
data | unknown |
params? | InexactPartial <ParseParams > |
Returns
T
["_output"
]
Inherited from
parseAsync
▸ parseAsync(data
, params?
): Promise
<T
["_output"
]>
Parameters
Name | Type |
---|---|
data | unknown |
params? | InexactPartial <ParseParams > |
Returns
Promise
<T
["_output"
]>
Inherited from
pipe
▸ pipe<T
>(target
): ZodPipeline
<ZodCatch
<T
>, T
>
Type parameters
Name | Type |
---|---|
T | extends ZodTypeAny |
Parameters
Name | Type |
---|---|
target | T |
Returns
ZodPipeline
<ZodCatch
<T
>, T
>
Inherited from
promise
▸ promise(): ZodPromise
<ZodCatch
<T
>>
Returns
ZodPromise
<ZodCatch
<T
>>
Inherited from
readonly
▸ readonly(): ZodReadonly
<ZodCatch
<T
>>
Returns
ZodReadonly
<ZodCatch
<T
>>
Inherited from
refine
▸ refine<RefinedOutput
>(check
, message?
): ZodEffects
<ZodCatch
<T
>, RefinedOutput
, unknown
>
Type parameters
Name | Type |
---|---|
RefinedOutput | extends any |
Parameters
Name | Type |
---|---|
check | (arg : T ["_output" ]) => arg is RefinedOutput |
message? | string | Partial <Omit <ZodCustomIssue , "code" >> | (arg : T ["_output" ]) => Partial <Omit <ZodCustomIssue , "code" >> |
Returns
ZodEffects
<ZodCatch
<T
>, RefinedOutput
, unknown
>
Inherited from
▸ refine(check
, message?
): ZodEffects
<ZodCatch
<T
>, T
["_output"
], unknown
>
Parameters
Name | Type |
---|---|
check | (arg : T ["_output" ]) => unknown |
message? | string | Partial <Omit <ZodCustomIssue , "code" >> | (arg : T ["_output" ]) => Partial <Omit <ZodCustomIssue , "code" >> |
Returns
ZodEffects
<ZodCatch
<T
>, T
["_output"
], unknown
>
Inherited from
refinement
▸ refinement<RefinedOutput
>(check
, refinementData
): ZodEffects
<ZodCatch
<T
>, RefinedOutput
, unknown
>
Type parameters
Name | Type |
---|---|
RefinedOutput | extends any |
Parameters
Name | Type |
---|---|
check | (arg : T ["_output" ]) => arg is RefinedOutput |
refinementData | IssueData | (arg : T ["_output" ], ctx : RefinementCtx ) => IssueData |
Returns
ZodEffects
<ZodCatch
<T
>, RefinedOutput
, unknown
>
Inherited from
▸ refinement(check
, refinementData
): ZodEffects
<ZodCatch
<T
>, T
["_output"
], unknown
>
Parameters
Name | Type |
---|---|
check | (arg : T ["_output" ]) => boolean |
refinementData | IssueData | (arg : T ["_output" ], ctx : RefinementCtx ) => IssueData |
Returns
ZodEffects
<ZodCatch
<T
>, T
["_output"
], unknown
>
Inherited from
removeCatch
▸ removeCatch(): T
Returns
T
safeParse
▸ safeParse(data
, params?
): SafeParseReturnType
<unknown
, T
["_output"
]>
Parameters
Name | Type |
---|---|
data | unknown |
params? | InexactPartial <ParseParams > |
Returns
SafeParseReturnType
<unknown
, T
["_output"
]>
Inherited from
safeParseAsync
▸ safeParseAsync(data
, params?
): Promise
<SafeParseReturnType
<unknown
, T
["_output"
]>>
Parameters
Name | Type |
---|---|
data | unknown |
params? | InexactPartial <ParseParams > |
Returns
Promise
<SafeParseReturnType
<unknown
, T
["_output"
]>>
Inherited from
superRefine
▸ superRefine<RefinedOutput
>(refinement
): ZodEffects
<ZodCatch
<T
>, RefinedOutput
, unknown
>
Type parameters
Name | Type |
---|---|
RefinedOutput | extends any |
Parameters
Name | Type |
---|---|
refinement | (arg : T ["_output" ], ctx : RefinementCtx ) => arg is RefinedOutput |
Returns
ZodEffects
<ZodCatch
<T
>, RefinedOutput
, unknown
>
Inherited from
▸ superRefine(refinement
): ZodEffects
<ZodCatch
<T
>, T
["_output"
], unknown
>
Parameters
Name | Type |
---|---|
refinement | (arg : T ["_output" ], ctx : RefinementCtx ) => void |
Returns
ZodEffects
<ZodCatch
<T
>, T
["_output"
], unknown
>
Inherited from
▸ superRefine(refinement
): ZodEffects
<ZodCatch
<T
>, T
["_output"
], unknown
>
Parameters
Name | Type |
---|---|
refinement | (arg : T ["_output" ], ctx : RefinementCtx ) => Promise <void > |
Returns
ZodEffects
<ZodCatch
<T
>, T
["_output"
], unknown
>
Inherited from
transform
▸ transform<NewOut
>(transform
): ZodEffects
<ZodCatch
<T
>, NewOut
, unknown
>
Type parameters
Name |
---|
NewOut |
Parameters
Name | Type |
---|---|
transform | (arg : T ["_output" ], ctx : RefinementCtx ) => NewOut | Promise <NewOut > |
Returns
ZodEffects
<ZodCatch
<T
>, NewOut
, unknown
>
Inherited from
~validate
▸ ~validate(data
): Result
<T
["_output"
]> | Promise
<Result
<T
["_output"
]>>
Parameters
Name | Type |
---|---|
data | unknown |
Returns
Result
<T
["_output"
]> | Promise
<Result
<T
["_output"
]>>