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

feat: add z.catch() resolution and default value JSDoc #78

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dan5py
Copy link

@dan5py dan5py commented Mar 16, 2024

Fixes #60.
Closes #77.

Adds support for z.catch so that the type is not set to any.

z.object({
    items: z.enum(['a', 'b', 'c']).catch('a'),
}).array()

Resolves to:

{
   items: "a" | "b" | "c";
}[]

dan5py and others added 3 commits March 16, 2024 17:34
@dan5py dan5py changed the title feat: add z.catch() resolution feat: add z.catch() resolution and default value JSDoc Mar 26, 2024
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.

Default values in jsdoc .catch() evaluates to any
2 participants