Skip to content
Discussion options

You must be logged in to vote

You can easily check

z.ZodType is base class for all zod schemas so you easily can do

const schema = z.object({})
if (schema instanceof z.ZodType) {
// this is zod type
}

If you want more specific checks

if (schema instanceof z.ZodObject) {
// this is zod object type 
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@colinhacks
Comment options

@MentalGear
Comment options

@eric-poitras
Comment options

Answer selected by alii
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants