Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 628 Bytes

README.md

File metadata and controls

32 lines (23 loc) · 628 Bytes

Prettify<Type> flattens type and makes it more readable on the hover in your IDE.

It shows what properties are included in interfaces:

interface Name {
  first: string;
  second: string;
}

type NameOnly = Name;
//   ^? Name

type FullName = Prettify<Name>;
//   ^? {first: string; second: string}

It flattens intersections:

type Intersection = Name & {
  address: string;
};

type IntersectionOnly = Intersection;
//   ^? Name & {address: string}

type EverythingAboutPerson = Prettify<Intersection>;
//   ^? {first: string; second: string; address: string}

TS Playground - https://tsplay.dev/m3d51W