ssalbdivad
ssalbdivad
Aarktype
Created by Tom on 2/13/2025 in #questions
can `optional()` be used with a thunk?
Yeah they're functionally identical
5 replies
Aarktype
Created by Tom on 2/13/2025 in #questions
can `optional()` be used with a thunk?
Could you just use a normal optional key like "field?"
5 replies
Aarktype
Created by ahrjarrett on 1/21/2025 in #questions
cross posting from #typescript
Should definitely have some time at least over the next couple weeks! Juggling a lot right now and trying to get caught up on consulting but would love to take a look as soon as I can
16 replies
Aarktype
Created by IOM on 2/9/2025 in #questions
Inference on Mapped Types with Exhaustive Switch Possible?
I'd say wait for match expressions which will be released this week. Seems like a much better fit for this use case from what I can tell
2 replies
Aarktype
Created by Father Christmas on 2/9/2025 in #questions
What is the ArkType equivalent of Zod's safeParse?
In older versions there was a discriminated union like this, but the instanceof type.errors check seems better in terms of ergonomics and is definitely better in terms of performance (no need to create a new result object).
18 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a way to have an async morph?
TS doesn't always give great hints for that kind of thing though depending on what keys you include first
22 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a way to have an async morph?
Yeah it's discriminated on code
22 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a way to have an async morph?
Great, will take a look at this on Tuesday, thank you!
22 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a way to have an async morph?
You can create a GitHub issue for it which would be helpful mostly for me for tracking purposes, but you might be overestimating the number of people trying to write docs for the project 😛
22 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a way to have an async morph?
There's a contributing guide yeah but it's not really doc specific. Broadly speaking though it's pretty easy to see how most of the repo works and to add docs similar to what else is there. I'd focus on stuff that is relatively objective and narrow (e.g. an faq on async validators or maybe more on reject) rather than high-level overviews of concepts which might be more nuanced. https://github.com/arktypeio/arktype/blob/main/.github/CONTRIBUTING.md
22 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a way to have an async morph?
Yeah you should have seen the docs a couple months ago though already a lot better. Trying to keep logging issues in the backlog to continue improving and add new functionality. Definitely an area I'd love contributions if you're so inclined!
22 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a way to have an async morph?
Taking the next couple days off so good timing on the questions 😅 There's some other folks in here who may able to chip in but yeah tough to get answers otherwise on my intent for some missing feature or similar
22 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a way to have an async morph?
Probably after? I guess it depends a bit on the situation but usually after
22 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a way to have an async morph?
Other than handling it as a promise on the output object, no. Something I've thought a bit about but it seems it would add a huge amount of complexity to the type system for somewhat marginal benefit? Would be interested in uses cases where it feels really impactful though and somewhat open to reconsidering in the long term
22 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a mustNotBe
I don't know lol maybe there's something good out there
13 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a mustNotBe
not ending in .project or ending in something other than .project
13 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a mustNotBe
Sorry I don't have a better answer! Hopefully you find something acceptable
13 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a mustNotBe
So you might be stuck between a rock and hard place in terms of a creative solution for the positive version or having to respecify actual
13 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a mustNotBe
Because if some errors are must not be it adds a ton of complexity to the logic for union messages
13 replies
Aarktype
Created by Raqueebuddin Aziz on 2/9/2025 in #questions
is there a mustNotBe
Yeah, the problem is the way it composes though that's why generally it's valuable to use must be ___
13 replies