We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 00cc73d commit e8f0967Copy full SHA for e8f0967
source/union-to-tuple.d.ts
@@ -53,7 +53,9 @@ const petList = Object.keys(pets) as UnionToTuple<Pet>;
53
*/
54
export type UnionToTuple<T, L = LastOfUnion<T>> =
55
IsNever<T> extends false
56
- ? [...UnionToTuple<ExcludeExactly<T, L>>, L]
+ ? UnionToTuple<ExcludeExactly<T, L>> extends infer E extends unknown[]
57
+ ? [...E, L]
58
+ : never
59
: [];
60
61
export {};
0 commit comments