Skip to content

Commit

Permalink
fix: add InstanceSchema to transformAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
Yovach committed Sep 2, 2023
1 parent 00d234f commit e6571e8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions library/src/methods/transform/transformAsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import type {
DateSchemaAsync,
EnumSchema,
EnumSchemaAsync,
InstanceSchema,
InstanceSchemaAsync,
LiteralSchema,
LiteralSchemaAsync,
MapSchema,
Expand Down Expand Up @@ -127,6 +129,14 @@ export function transformAsync<
action: (value: Output<TSchema>) => TOutput | Promise<TOutput>
): EnumSchemaAsync<TSchema['enum'], TOutput>;

export function transformAsync<
TSchema extends InstanceSchema<any> | InstanceSchemaAsync<any>,
TOutput
>(
schema: TSchema,
action: (value: Output<TSchema>) => TOutput | Promise<TOutput>
): InstanceSchemaAsync<TSchema['class'], TOutput>;

export function transformAsync<
TSchema extends LiteralSchema<any> | LiteralSchemaAsync<any>,
TOutput
Expand Down

0 comments on commit e6571e8

Please sign in to comment.