Writing generic functions for Zod Objects #2595
Unanswered
DouglasdeMoura
asked this question in
Q&A
Replies: 1 comment
-
Bumping this. I'm running into this same thing right now and having trouble finding an example of functions that take in a zod object as a parameter and perform an |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to write a generic function that receives a Zod Schema, call the
.omit({ id: true })
on it and return it. Similarly to the example on the documentation, I've tried this:Unfortunately, this does not give me the correct type for the
CreateSchema
:So, is it possible to do what I'm trying to achieve?
Beta Was this translation helpful? Give feedback.
All reactions