jacksteamdev
Aarktype
•Created by jacksteamdev on 11/9/2024 in #questions
Union Fallthrough?
I'm transforming some input using morphs like so:
And creating a union type like this, where
otherUnit.unit
is "string":
I expected otherUnit
to catch non-matching values, but I'm getting this error:
Which makes sense if the union is unordered.
Is there a way to make this union ordered? If not, is there a more fluent way to do this than wrapping it in a function?16 replies
Aarktype
•Created by jacksteamdev on 10/31/2023 in #questions
Unions with optional params?
Are unions with optional params supported in arktype?
Example:
https://stackblitz.com/edit/fhz11y?file=type.ts
5 replies
Aarktype
•Created by jacksteamdev on 8/8/2023 in #questions
How to validate that a value is an instance of a class
Is there a way (yet) to validate that a value is an instance of a class?
I know this doesn't work, but maybe it'll convey the idea:
23 replies