Skip to content

Instantly share code, notes, and snippets.

@lucaswinningham
Created September 15, 2023 18:31
Show Gist options
  • Save lucaswinningham/ee4ac2f7c066dd4db8617756fe16e6ed to your computer and use it in GitHub Desktop.
Save lucaswinningham/ee4ac2f7c066dd4db8617756fe16e6ed to your computer and use it in GitHub Desktop.
VS Code expand props more
// https://stackoverflow.com/questions/57683303/how-can-i-see-the-full-expanded-contract-of-a-typescript-type
// expands object types one level deep
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
// expands object types recursively
type ExpandRecursively<T> = T extends object
? T extends infer O ? { [K in keyof O]: ExpandRecursively<O[K]> } : never
: T;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment