Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fostyfost
Created July 8, 2021 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fostyfost/ae2732e1a4511ebd5f5a8d4a8e7d0f29 to your computer and use it in GitHub Desktop.
Save fostyfost/ae2732e1a4511ebd5f5a8d4a8e7d0f29 to your computer and use it in GitHub Desktop.
Known Keys
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