Created
September 29, 2022 23:39
-
-
Save cefn/784a6384f51de364de9edcfb53cc8f47 to your computer and use it in GitHub Desktop.
Typescript - derive index of tuple from tuple type
This file contains hidden or 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 IndexOf<T extends {length: number}> = Exclude<Partial<T>["length"], T['length']> & number; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment