Skip to content

Instantly share code, notes, and snippets.

@o-az
Created May 23, 2023 11:33
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 o-az/ae6161dd5bbe7438f27c4fbefc514a36 to your computer and use it in GitHub Desktop.
Save o-az/ae6161dd5bbe7438f27c4fbefc514a36 to your computer and use it in GitHub Desktop.
Type helper to force TypeScript to simplify the type
/**
* Wrap any complex and hard to read type with this
* and it'll magically be a lot simpler on hover.
*/
export type Pretty<T> = { [K in keyof T]: T[K] } & {};
@o-az
Copy link
Author

o-az commented May 23, 2023

credit: @mattpocock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment