Bence (Arzen)
ZZod
•Created by Bence (Arzen) on 10/16/2024 in #questions
Bence (Arzen) - Hi guys 🙂 Is there a way to cr...
Yes, it is a serious project. I'm using zod at work for our internal site. In the end I changed zod for Effect.Schema as zod was quite restrictive and couldn't do what I wanted it to do. :\
10 replies
ZZod
•Created by Bence (Arzen) on 10/16/2024 in #questions
Bence (Arzen) - Hi guys 🙂 Is there a way to cr...
that's a good shout! Thank you! 🙂
10 replies
ZZod
•Created by Bence (Arzen) on 10/16/2024 in #questions
Bence (Arzen) - Hi guys 🙂 Is there a way to cr...
I wasn't planning too haha
10 replies
ZZod
•Created by Bence (Arzen) on 10/16/2024 in #questions
Bence (Arzen) - Hi guys 🙂 Is there a way to cr...
Thank you Steve! I'll take a look at your examples 👍
10 replies
ZZod
•Created by Bence (Arzen) on 5/15/2024 in #questions
Bence (Arzen) - Hey guys 🙂I have a (might be)...
Thank you for your insight! 🙂 It was very useful, I'll do my best to embrace what the language provides.
22 replies
ZZod
•Created by Bence (Arzen) on 5/15/2024 in #questions
Bence (Arzen) - Hey guys 🙂I have a (might be)...
I had a sort of "solution" but thought there is something better that I do not know of:
I understand your point of view.
My main reason why I want to enforce type safety and create reference and id types is to avoid passing in something unintended around my codebase and scratch my head why everything collapses.
My issues it type aliases in TS. Consider the following code:
I "understand" that we only created a type alias but coming from Scala I hate this behaviour 😂
22 replies
ZZod
•Created by Bence (Arzen) on 5/15/2024 in #questions
Bence (Arzen) - Hey guys 🙂I have a (might be)...
I don't think the global error map will work. I also tried to use
refine
and superRefine
but if the example schema above (userIdSchema
) failes, it will not propogate anything to the refine/superRefine
block (as it is expected I believe)22 replies
ZZod
•Created by Bence (Arzen) on 5/15/2024 in #questions
Bence (Arzen) - Hey guys 🙂I have a (might be)...
@here sorry for the late reply. I didn't get any notification from the server for some reason.
The schema I am trying to override the error on is indeed simple.
I'll get you guys some code example how it's being created then how I try to use it later in our codebase.
Schema creation example:
I am using a couple of helper libraries which aren't really important to include here.
Then the way I create these types is the following:
Once I have the
userIdInstance
I can access the schema on it and safely wrap or unwrap any values.
The type we end up with is the following:
The way I use it is the following:
22 replies