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
It would work exactly like z.string() would, but when parsing it, the type would be Id. The Id type is just a string, but has it's own type so you are aware it shouldn't be "any" string. Is there a way to do this?
Currently I have found a work around by doing z.string().transform((v) => v as Id) but I was wondering if theres a better / cleaner way to do it
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I want to have something like this:
z.string<Id>()It would work exactly like
z.string()would, but when parsing it, the type would beId. TheIdtype is just a string, but has it's own type so you are aware it shouldn't be "any" string. Is there a way to do this?Currently I have found a work around by doing
z.string().transform((v) => v as Id)but I was wondering if theres a better / cleaner way to do itBeta Was this translation helpful? Give feedback.
All reactions