Skip to content

@kaelyx/ts-kit / types / Prettify

Type Alias: Prettify<T> ​

Prettify<T> = { [K in keyof T]: T[K] } & object

Defined in: types/prettify/prettify.types.ts:19

A utility type that makes an object type more readable by flattening its structure. This is particularly useful for complex nested types where readability is important. It essentially "flattens" the type, making it easier to read and work with in TypeScript.

Type Parameters ​

T ​

T

Returns ​

The prettified version of the input type.

Example ​

ts
type A = { id: number } & { name: string }
// hover shows: { id: number } & { name: string }
type B = Prettify<A>
// hover shows: { id: number; name: string }