title: Core.z. Zod Nullable
A2A Node SDK - v0.1.0 / Modules / Core / z / ZodNullable
Class: ZodNullable<T>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Hierarchy
-
ZodType<T["_output"] |null,ZodNullableDef<T>,T["_input"] |null>↳
ZodNullable
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
- safeParse
- safeParseAsync
- superRefine
- transform
- unwrap
- ~validate
Constructors
constructor
• new ZodNullable<T>(def): ZodNullable<T>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
def | ZodNullableDef<T> |
Returns
ZodNullable<T>
Inherited from
Properties
_def
• Readonly _def: ZodNullableDef<T>
Inherited from
_input
• Readonly _input: null | T["_input"]
Inherited from
_output
• Readonly _output: null | T["_output"]
Inherited from
_type
• Readonly _type: null | T["_output"]
Inherited from
create
▪ Static create: <Inner>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>
Type declaration
▸ <Inner>(type, params?): ZodNullable<Inner>
Type parameters
| Name | Type |
|---|---|
Inner | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
type | Inner |
params? | RawCreateParams |
Returns
ZodNullable<Inner>
spa
• spa: (data: unknown, params?: InexactPartial<ParseParams>) => Promise<SafeParseReturnType<null | T["_input"], null | T["_output"]>>
Alias of safeParseAsync
Type declaration
▸ (data, params?): Promise<SafeParseReturnType<null | T["_input"], null | T["_output"]>>
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
Promise<SafeParseReturnType<null | T["_input"], null | T["_output"]>>
Inherited from
~standard
• ~standard: Props<null | T["_input"], null | 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<null | T["_output"]>
Parameters
| Name | Type |
|---|---|
input | ParseInput |
Returns
ParseReturnType<null | T["_output"]>
Overrides
_parseAsync
▸ _parseAsync(input): AsyncParseReturnType<null | T["_output"]>
Parameters
| Name | Type |
|---|---|
input | ParseInput |
Returns
AsyncParseReturnType<null | T["_output"]>
Inherited from
_parseSync
▸ _parseSync(input): SyncParseReturnType<null | T["_output"]>
Parameters
| Name | Type |
|---|---|
input | ParseInput |
Returns
SyncParseReturnType<null | 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<ZodNullable<T>, null | T["_output"], null | T["_input"]>
Parameters
| Name | Type |
|---|---|
refinement | (arg: null | T["_output"], ctx: RefinementCtx) => any |
Returns
ZodEffects<ZodNullable<T>, null | T["_output"], null | T["_input"]>
Inherited from
and
▸ and<T>(incoming): ZodIntersection<ZodNullable<T>, T>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
incoming | T |
Returns
ZodIntersection<ZodNullable<T>, T>
Inherited from
array
▸ array(): ZodArray<ZodNullable<T>, "many">
Returns
ZodArray<ZodNullable<T>, "many">
Inherited from
brand
▸ brand<B>(brand?): ZodBranded<ZodNullable<T>, B>
Type parameters
| Name | Type |
|---|---|
B | extends string | number | symbol |
Parameters
| Name | Type |
|---|---|
brand? | B |
Returns
ZodBranded<ZodNullable<T>, B>
Inherited from
catch
▸ catch(def): ZodCatch<ZodNullable<T>>
Parameters
| Name | Type |
|---|---|
def | null | T["_output"] |
Returns
ZodCatch<ZodNullable<T>>
Inherited from
▸ catch(def): ZodCatch<ZodNullable<T>>
Parameters
| Name | Type |
|---|---|
def | (ctx: { error: ZodError<any> ; input: null | T["_input"] }) => null | T["_output"] |
Returns
ZodCatch<ZodNullable<T>>
Inherited from
default
▸ default(def): ZodDefault<ZodNullable<T>>
Parameters
| Name | Type |
|---|---|
def | null | noUndefined<T["_input"]> |
Returns
Inherited from
▸ default(def): ZodDefault<ZodNullable<T>>
Parameters
| Name | Type |
|---|---|
def | () => null | noUndefined<T["_input"]> |
Returns
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<ZodNullable<T>>
Returns
Inherited from
nullish
▸ nullish(): ZodOptional<ZodNullable<ZodNullable<T>>>
Returns
ZodOptional<ZodNullable<ZodNullable<T>>>
Inherited from
optional
▸ optional(): ZodOptional<ZodNullable<T>>
Returns
Inherited from
or
▸ or<T>(option): ZodUnion<[ZodNullable<T>, T]>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
option | T |
Returns
ZodUnion<[ZodNullable<T>, T]>
Inherited from
parse
▸ parse(data, params?): null | T["_output"]
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
null | T["_output"]
Inherited from
parseAsync
▸ parseAsync(data, params?): Promise<null | T["_output"]>
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
Promise<null | T["_output"]>
Inherited from
pipe
▸ pipe<T>(target): ZodPipeline<ZodNullable<T>, T>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
target | T |
Returns
ZodPipeline<ZodNullable<T>, T>
Inherited from
promise
▸ promise(): ZodPromise<ZodNullable<T>>
Returns
Inherited from
readonly
▸ readonly(): ZodReadonly<ZodNullable<T>>
Returns
Inherited from
refine
▸ refine<RefinedOutput>(check, message?): ZodEffects<ZodNullable<T>, RefinedOutput, null | T["_input"]>
Type parameters
| Name | Type |
|---|---|
RefinedOutput | extends any |
Parameters
| Name | Type |
|---|---|
check | (arg: null | T["_output"]) => arg is RefinedOutput |
message? | string | Partial<Omit<ZodCustomIssue, "code">> | (arg: null | T["_output"]) => Partial<Omit<ZodCustomIssue, "code">> |
Returns
ZodEffects<ZodNullable<T>, RefinedOutput, null | T["_input"]>
Inherited from
▸ refine(check, message?): ZodEffects<ZodNullable<T>, null | T["_output"], null | T["_input"]>
Parameters
| Name | Type |
|---|---|
check | (arg: null | T["_output"]) => unknown |
message? | string | Partial<Omit<ZodCustomIssue, "code">> | (arg: null | T["_output"]) => Partial<Omit<ZodCustomIssue, "code">> |
Returns
ZodEffects<ZodNullable<T>, null | T["_output"], null | T["_input"]>
Inherited from
refinement
▸ refinement<RefinedOutput>(check, refinementData): ZodEffects<ZodNullable<T>, RefinedOutput, null | T["_input"]>
Type parameters
| Name | Type |
|---|---|
RefinedOutput | extends any |
Parameters
| Name | Type |
|---|---|
check | (arg: null | T["_output"]) => arg is RefinedOutput |
refinementData | IssueData | (arg: null | T["_output"], ctx: RefinementCtx) => IssueData |
Returns
ZodEffects<ZodNullable<T>, RefinedOutput, null | T["_input"]>
Inherited from
▸ refinement(check, refinementData): ZodEffects<ZodNullable<T>, null | T["_output"], null | T["_input"]>
Parameters
| Name | Type |
|---|---|
check | (arg: null | T["_output"]) => boolean |
refinementData | IssueData | (arg: null | T["_output"], ctx: RefinementCtx) => IssueData |
Returns
ZodEffects<ZodNullable<T>, null | T["_output"], null | T["_input"]>
Inherited from
safeParse
▸ safeParse(data, params?): SafeParseReturnType<null | T["_input"], null | T["_output"]>
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
SafeParseReturnType<null | T["_input"], null | T["_output"]>
Inherited from
safeParseAsync
▸ safeParseAsync(data, params?): Promise<SafeParseReturnType<null | T["_input"], null | T["_output"]>>
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
Promise<SafeParseReturnType<null | T["_input"], null | T["_output"]>>
Inherited from
superRefine
▸ superRefine<RefinedOutput>(refinement): ZodEffects<ZodNullable<T>, RefinedOutput, null | T["_input"]>
Type parameters
| Name | Type |
|---|---|
RefinedOutput | extends any |
Parameters
| Name | Type |
|---|---|
refinement | (arg: null | T["_output"], ctx: RefinementCtx) => arg is RefinedOutput |
Returns
ZodEffects<ZodNullable<T>, RefinedOutput, null | T["_input"]>
Inherited from
▸ superRefine(refinement): ZodEffects<ZodNullable<T>, null | T["_output"], null | T["_input"]>
Parameters
| Name | Type |
|---|---|
refinement | (arg: null | T["_output"], ctx: RefinementCtx) => void |
Returns
ZodEffects<ZodNullable<T>, null | T["_output"], null | T["_input"]>
Inherited from
▸ superRefine(refinement): ZodEffects<ZodNullable<T>, null | T["_output"], null | T["_input"]>
Parameters
| Name | Type |
|---|---|
refinement | (arg: null | T["_output"], ctx: RefinementCtx) => Promise<void> |
Returns
ZodEffects<ZodNullable<T>, null | T["_output"], null | T["_input"]>
Inherited from
transform
▸ transform<NewOut>(transform): ZodEffects<ZodNullable<T>, NewOut, null | T["_input"]>
Type parameters
| Name |
|---|
NewOut |
Parameters
| Name | Type |
|---|---|
transform | (arg: null | T["_output"], ctx: RefinementCtx) => NewOut | Promise<NewOut> |
Returns
ZodEffects<ZodNullable<T>, NewOut, null | T["_input"]>
Inherited from
unwrap
▸ unwrap(): T
Returns
T
~validate
▸ ~validate(data): Result<null | T["_output"]> | Promise<Result<null | T["_output"]>>
Parameters
| Name | Type |
|---|---|
data | unknown |
Returns
Result<null | T["_output"]> | Promise<Result<null | T["_output"]>>