Replies: 1 comment 1 reply
-
|
Do branded types solve your issue? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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