Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types to ZodContext.invalid #48

Merged
merged 1 commit into from May 19, 2024
Merged

Conversation

tomaskallup
Copy link
Contributor

@tomaskallup tomaskallup commented May 6, 2024

I've been trying to use this router in a project of mine, where I would like to handle validation my way (I return html <form> and I want to embed the errors in it) and ran into issue with types for the ctx.invalid. Since it didn't give any type to ZodError, it had no properties and I had to force them via type assertion.

This PR tries to fix that, I hope I did it right. Everything seems to build, tests do pass.

@JakeFenley
Copy link
Owner

hi @tomaskallup thank you for this, this looks great! I'll have a closer look at this when i get a chance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants