Created
July 8, 2021 21:18
-
-
Save fostyfost/ae2732e1a4511ebd5f5a8d4a8e7d0f29 to your computer and use it in GitHub Desktop.
Known Keys
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 KnownKeys<T> = { | |
[K in keyof T]: string extends K ? never : number extends K ? never : K | |
} extends { [_ in keyof T]: infer U } ? U : never; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment