Skip to content

Commit

Permalink
fix: nested zodeffects throws errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Nov 16, 2022
1 parent 1a417f8 commit c373457
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/parsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ import { z } from 'zod'

type UnknownKeysParam = 'passthrough' | 'strict' | 'strip'

type Refined<T extends z.ZodType> = T extends z.ZodType<infer O>
? z.ZodEffects<T, O, O>
: never

type Schema<U extends UnknownKeysParam = any> =
| z.ZodObject<any, U>
| z.ZodUnion<[Schema<U>, ...Schema<U>[]]>
| z.ZodIntersection<Schema<U>, Schema<U>>
| z.ZodDiscriminatedUnion<string, z.Primitive, z.ZodObject<any, U>>
| Refined<z.ZodObject<any, U>>
| z.ZodEffects<z.ZodTypeAny>

type ParsedData<T extends Schema | z.ZodRawShape> = T extends Schema
? z.output<T>
Expand Down

1 comment on commit c373457

@wobsoriano
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closes #4

Please sign in to comment.