ZodRequestClass
Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.
ZodRequestClass<
TSchema,TBase> =InstanceType<TBase> &output<TSchema>
Defined in: packages/pipeline-zod/src/create-zod-request.ts:43
Type Parameters
Section titled “Type Parameters”TSchema
Section titled “TSchema”TSchema extends ZodType
TBase extends AbstractConstructor
new ZodRequestClass(
input, …baseArgs):InstanceType<TBase> &output<TSchema>
Parameters
Section titled “Parameters”input<TSchema>
baseArgs
Section titled “baseArgs”…ConstructorParameters<TBase>
Returns
Section titled “Returns”InstanceType<TBase> & output<TSchema>
Properties
Section titled “Properties”_zodSchema
Section titled “_zodSchema”
readonly_zodSchema:TSchema
Defined in: packages/pipeline-zod/src/create-zod-request.ts:51
~standard
Section titled “~standard”
readonly~standard:unknown
Defined in: packages/pipeline-zod/src/create-zod-request.ts:53
schema
Section titled “schema”
readonlyschema:TSchema
Defined in: packages/pipeline-zod/src/create-zod-request.ts:52
Methods
Section titled “Methods”parse()
Section titled “parse()”parse(
input, …baseArgs):InstanceType<TBase> &output<TSchema>
Defined in: packages/pipeline-zod/src/create-zod-request.ts:54
Parameters
Section titled “Parameters”input<TSchema>
baseArgs
Section titled “baseArgs”…ConstructorParameters<TBase>
Returns
Section titled “Returns”InstanceType<TBase> & output<TSchema>
parseAsync()
Section titled “parseAsync()”parseAsync(
input, …baseArgs):Promise<InstanceType<TBase> &output<TSchema>>
Defined in: packages/pipeline-zod/src/create-zod-request.ts:71
Validates asynchronously, then constructs the request instance.
Use this for schemas with async refinements/transforms. The normal constructor and parse are synchronous and therefore require a synchronously parseable schema.
Parameters
Section titled “Parameters”input<TSchema>
baseArgs
Section titled “baseArgs”…ConstructorParameters<TBase>
Returns
Section titled “Returns”Promise<InstanceType<TBase> & output<TSchema>>
Example
Section titled “Example”const command = await CreateUserCommand.parseAsync(input);await commandBus.execute(command);safeParse()
Section titled “safeParse()”safeParse(
input):ReturnType<TSchema["safeParse"]>
Defined in: packages/pipeline-zod/src/create-zod-request.ts:75
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”ReturnType<TSchema["safeParse"]>