Last active
January 28, 2022 02:31
-
-
Save xwartz/a38da0a520c8907d50ac44ca51d87f39 to your computer and use it in GitHub Desktop.
interview-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
/** | |
* 给定数组,转换为对象类型,键/值必须在给定数组中。 | |
**/ | |
// Example: | |
const tuple = ['tesla', 'model 3', 'model X', 'model Y'] as const | |
const result: TupleToObject<typeof tuple> // expected { tesla: 'tesla', 'model 3': 'model 3', 'model X': 'model X', 'model Y': 'model Y'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment