You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A correct typing for the out of the back but wrong for the front, the real type that the front obtains is the following :
{
firstname: string;
dateOfBirth: string;// containe Date in this string}
(Same problem for typing back entries)
Proposed solution :
zodToTs(zodSchema,identifier,[{type: ZodDate,callback: (zodDate)=>{if(zodDate.def.coerce){returnzod.string()// replace a current ZodDate meets to ZodString}returnzodDate}},])
The operation would be simple, just before processing a type we look in the list if it has a match and if so launches the callback. the object returned from the callback will be the one that will be processed by the converter.
Thank you for your work. 😄
The text was updated successfully, but these errors were encountered:
I use this library to generate my front typing. But I encounter a problem with certain specific cases.
If my back returns an object with dates like this:
The generated type will be the following :
A correct typing for the out of the back but wrong for the front, the real type that the front obtains is the following :
(Same problem for typing back entries)
Proposed solution :
The operation would be simple, just before processing a type we look in the list if it has a match and if so launches the callback. the object returned from the callback will be the one that will be processed by the converter.
Thank you for your work. 😄
The text was updated successfully, but these errors were encountered: