Created
November 30, 2025 00:13
-
-
Save anztrax/ce97c82d667888a34a3b669bb86bab4c to your computer and use it in GitHub Desktop.
Simple Implemention Tuple to Object
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
| // this version using any | |
| type TupleToObject<T extends readonly (keyof any)[]> = { | |
| [A in T[number]]: A | |
| } | |
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
| // this version not using any, use PropertyKey instead | |
| type TupleToObject<T extends readonly PropertyKey[]> = { | |
| [A in T[number]]: A | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment