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

.catch() evaluates to any #60

Open
robertkossendey opened this issue Nov 21, 2023 · 0 comments · May be fixed by #78
Open

.catch() evaluates to any #60

robertkossendey opened this issue Nov 21, 2023 · 0 comments · May be fixed by #78

Comments

@robertkossendey
Copy link

robertkossendey commented Nov 21, 2023

Currently, this: Test: z.string().nullable().catch(null) evaluates to Test?: any, although it can only be string | null. Do you see a possibility to improve this?

Reproducible example:

const TestSchema = z.object({
    Test: z.string().nullable().catch(null)
});

console.log((printNode(zodToTs(TestSchema).node)));
@dan5py dan5py linked a pull request Mar 16, 2024 that will close this issue
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 a pull request may close this issue.

1 participant