Unions with optional params?
Are unions with optional params supported in arktype?
Example:
https://stackblitz.com/edit/fhz11y?file=type.ts
1 Reply
I think in the StackBlitz
// operator
should be commented out on line 19 to repro the bug?
But yeah, this is definitely a bug. Probably to do with discrimination if I had to guess- maybe there is some issue with discriminating on an optional key?
Yeah, it does look like that. You can see the structure of what it's checking here:
It incorrectly discriminates on 'operatator'
even though it's not required in all branches
This seems like something I could likely fix trivially, let me check
@jacksteamdev Well, wasn't quite as trivial as I was hoping- the new TypeNodes are so much easier to work with than the old ones 😅
Anyways, try 1.0.26-alpha