We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// 730 - Union to Tuple
type UnionToIntersection = ( U extends unknown ? (arg: U) => 0 : never ) extends (arg: infer I) => 0 ? I : never;
type LastInUnion = UnionToIntersection< U extends unknown ? (x: U) => 0 : never
extends (x: infer L) => 0 ? L : never;
type UnionToTuple<U, Last = LastInUnion> = [U] extends [never] ? [] : [...UnionToTuple<Exclude<U, Last>>, Last];
The text was updated successfully, but these errors were encountered:
No branches or pull requests
// 730 - Union to Tuple
type UnionToIntersection = (
U extends unknown ? (arg: U) => 0 : never
) extends (arg: infer I) => 0
? I
: never;
type LastInUnion = UnionToIntersection<
U extends unknown ? (x: U) => 0 : never
type UnionToTuple<U, Last = LastInUnion> = [U] extends [never]
? []
: [...UnionToTuple<Exclude<U, Last>>, Last];
The text was updated successfully, but these errors were encountered: