Suppose you have a type that has many intersections:
export type SimpleShape = {
color: string;
} & {
size: number;
} & {
shape: "circle" | "square";
};
When you hover over the type SimpleShape
with many intersections, it can be difficult to see the resolved type. It would be helpful if there was a way to prettify the display of these types.
With Prettify
we can using:
type Shape = Prettify<SimpleShape>;
// ^? type Shape = {
// color: string;
// size: number;
// shape: "circle" | "square";
// }
This is really helpful. Thank you, Matt!
This works for nested objects