Prettify<T>
typeFlattens an intersection into a single object type.
Chaining decorations produces
S & Record<"a", A> & Record<"b", B>, which is correct but
displays as an intersection in every hover and error message. This collapses it.
Apply it at the **top level only**. It is a homomorphic mapped type, so running it over a
slice whose state *is* a Map, Set or Date destroys that type - the same failure
DeepReadonly handles the built-ins explicitly to avoid.Definition
type
type Prettify<T> = { [K in keyof T]: T[K] } & object{ [K in keyof T]: T[K] } & object
Type parameters
| Name | Type | Description |
|---|---|---|
T | — |