types-kit.simplify.md
September 4, 2023 ยท View on GitHub
Simplify type
Flatten the type output to improve type hints shown in editors.
Signature:
export type Simplify<T> = {
[K in keyof T]: T[K]
}
Example
type Props = { a: 1, b: 2, c: 3 } & { d: 4 }
// Expect: { a: 1, b: 2, c: 3, d: 4 }
type SimplifiedProps = Simplify<Props>