Skip to content

Commit

Permalink
Merge pull request #138 from Yovach/fix/missing-transform-async-instance
Browse files Browse the repository at this point in the history
fix: add InstanceSchema to transformAsync
  • Loading branch information
fabian-hiller authored Sep 8, 2023
2 parents 478bfc0 + e6571e8 commit 8eab50e
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 8eab50e

Please sign in to comment.