Bobakanoosh
Explore posts from serversAarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
Awesome thanks again!!
32 replies
Aarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
Will watch that ticket and use the helper method in the meantime
32 replies
Aarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
awesome
32 replies
Aarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
that’s true yeah
32 replies
Aarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
Yeah fair that does seem very ideal
32 replies
Aarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
But “the Zod way” is adding a new thing in the same “code path” that already exists for configuration
32 replies
Aarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
Sure yeah they both add new things
32 replies
Aarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
Not sure how complex that would be to add to the error object
32 replies
Aarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
then you could just say
if(err.code === “pattern” && err.subtype === “email”)
within the already existing configuration system32 replies
Aarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
Regarding that ticket, what are your thoughts on Zods approach of exposing the “subtype” on the error instead?
By doing that, it would keep the library simpler by not adding another new concept if that makes sense
32 replies
Aarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
Def agree a wrapper would help it as well.
32 replies
Aarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
Yeah I mean my goal is to make sure the other engineers on my team have a seamless experience adopting Arktype, so everything I can do to reduce friction the better.
32 replies
Aarktype
•Created by Bobakanoosh on 1/28/2025 in #questions
How can I globally configure a subtypes error
Huh ok solution 2 seems a little verbose but would accomplish what I’m looking for, since the end goal is to configure this once.
solution 1 is definetly a good fallback, though the downside to me is now other developers have to remember to use the custom one vs the native one.
Option 3 has the same pitfall, but nice to know that syntax
32 replies
Aarktype
•Created by Bobakanoosh on 11/15/2024 in #questions
Using scope with morphs
For posterity, finally got everything working, last part was having a default value in the event the parsing failed. For that I just needed to use the type
type.Any<TData>['inferOut']
Thanks again!59 replies
Aarktype
•Created by Bobakanoosh on 11/15/2024 in #questions
Using scope with morphs
Yeah those are some good "basics" that I think would go a long way. Appreciate all your work!!
59 replies
Aarktype
•Created by Bobakanoosh on 11/15/2024 in #questions
Using scope with morphs
And TBH that stuff will also happen if you're e.g. writing a Zod schema and wanting to pass it to your own generics based on constraintsYeah I ran into this when making some frontend form/form input components
59 replies
Aarktype
•Created by Bobakanoosh on 11/15/2024 in #questions
Using scope with morphs
It's definetly come leaps and bounds from even a few weeks ago, I see the progress 🙂
59 replies
Aarktype
•Created by Bobakanoosh on 11/15/2024 in #questions
Using scope with morphs
was weeks ago
59 replies
Aarktype
•Created by Bobakanoosh on 11/15/2024 in #questions
Using scope with morphs
I might've searched the discord tbh i forget
59 replies
Aarktype
•Created by Bobakanoosh on 11/15/2024 in #questions
Using scope with morphs
I keep wanting to use this lib because I see the potential but it can be demotivating losing hours to it :/ (as it usually goes with complex types though)
59 replies