Skip to content

Commit

Permalink
fix: malfunctioning conditional type over any
Browse files Browse the repository at this point in the history
  • Loading branch information
DJankauskas committed Jul 6, 2023
1 parent bdbfe1c commit da42f1c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/ts-to-zod/src/types.ts
Expand Up @@ -15,9 +15,7 @@ export abstract class Transform<I, O> extends SchemaType<I, O> {
): O | PromiseLike<O>;
}

export type input<T> = any extends T
? any
: T extends SchemaType<any, infer I>
export type input<T> = T extends SchemaType<any, infer I>
? input<I>
: T extends z.ZodTypeAny
? z.input<T>
Expand All @@ -35,9 +33,7 @@ export type input<T> = any extends T
? PromiseLike<input<E>>
: T;

export type output<T> = any extends T
? any
: T extends SchemaType<any, infer I>
export type output<T> = T extends SchemaType<any, infer I>
? output<I>
: T extends z.ZodTypeAny
? z.output<T>
Expand Down Expand Up @@ -188,7 +184,7 @@ export class DateSchema<Props extends DateSchemaProps> extends SchemaType<
interface ObjectSchemaProps {
passthrough?: OptionalMessage<true>;
strict?: OptionalMessage<true>;
catchall?: any,
catchall?: any;
}

export class ObjectSchema<
Expand All @@ -215,4 +211,3 @@ export class SetSchema<T, Props extends SetSchemaProps> extends SchemaType<
Set<T>,
Set<T>
> {}

0 comments on commit da42f1c

Please sign in to comment.