Open macmillen opened 3 months ago
I realized that this:
type LiteralList<T extends string, U = T> = [T] extends [never]
? []
: U extends T
? [U, ...LiteralList<Exclude<T, U>>]
: [];
for some reason is really slowing down the TS language server.
Is there maybe another way to achieve this?
I want to be able to define an array that contains exactly the elements of all possible values of a union once.
I already made this work with this type:
I'm not sure though if it makes sense since I asked ChatGPT to do it.
Is it possible to add this type helper to type-fest?
Upvote & Fund