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

z.coerce in ts-to-zod #201

Open
fucksophie opened this issue Feb 6, 2024 · 2 comments
Open

z.coerce in ts-to-zod #201

fucksophie opened this issue Feb 6, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@fucksophie
Copy link

Feature description

A comment such as

/*
* @coerce true
*/
hello: number;

will turn the resulting z.number() into z.coerce.number()

Input

/*
* @coerce true
*/
hello: number;

Output

hello: z.coerce.number()
@schiller-manuel
Copy link
Collaborator

Feel free to create a PR!

@fucksophie
Copy link
Author

Just saw, this feature has been implemented in #125, just that the PR's author hasn't written any tests for it yet..

@tvillaren tvillaren added the enhancement New feature or request label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants