schema key alias
Is there a way that I can create an alias to a key in the type?
Like this:
7 Replies
What behavior do you want when parsing 0, 1 or 2 of the kesy?
it should be just one of, like in ts you can
{ quality: number; q: never } | { quality: never; q: number }
maybe I can create a arktype generic that would result in this?Yeah you could do that with a generic. Maybe will add in a builtin
xorProps
at some pointit should look like this? https://arktype.io/docs/generics#hkt
You would probably have an easier time with the external wrapper version
do you have any idea on how to implement this? I'm having a hard time understanding this part of the docs
I need to start giving out vouchers for answering a limited number of these kinds of questions haha
(made a slight correction as I had forgotten to include extraProp in the result)