Created
May 23, 2023 11:33
-
-
Save o-az/ae6161dd5bbe7438f27c4fbefc514a36 to your computer and use it in GitHub Desktop.
Type helper to force TypeScript to simplify the type
This file contains 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
/** | |
* 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] } & {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
credit: @mattpocock