ts-to-zod icon indicating copy to clipboard operation
ts-to-zod copied to clipboard

z.coerce in ts-to-zod

Open fucksophie opened this issue 6 months ago • 2 comments

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()

fucksophie avatar Feb 06 '24 09:02 fucksophie

Feel free to create a PR!

schiller-manuel avatar Feb 06 '24 21:02 schiller-manuel

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

fucksophie avatar Feb 11 '24 02:02 fucksophie