Created
May 14, 2024 16:30
-
-
Save zwhitchcox/683de781f57a8c9fd5d1891db9d6cd3b to your computer and use it in GitHub Desktop.
Type Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type CombineTuples<T extends [[number] | number[]] | ([number] | number[])[]> = | |
T extends [infer A, ...infer B] | |
? A extends number[] | [number] | |
? B extends [number[] | [number]] | ([number] | number[])[] | |
? [...A, ...CombineTuples<B>] | |
: never | |
: never | |
: [] | |
type J = CombineTuples<[[1, 2, 3], [4, 5, 6]]> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment