Skip to content

Instantly share code, notes, and snippets.

@martinhj
Created November 21, 2023 10:05
Show Gist options
  • Save martinhj/72b441be2154881533999a14a4c07d01 to your computer and use it in GitHub Desktop.
Save martinhj/72b441be2154881533999a14a4c07d01 to your computer and use it in GitHub Desktop.
Matt Pocock's `Prettify` TypeScript helper type
/**
* A TypeScript type alias called `Prettify`.
* It takes a type as its argument and returns a new type that has the same properties as the original type,
* but the properties are not intersected. This means that the new type is easier to read and understand.
*/
export type Prettify<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