feat(typescript-types): Add Simplify<T, E, I>

This commit is contained in:
T. R. Bernstein
2025-07-15 11:19:43 +02:00
parent 9700b7d46d
commit 2aa71d91e4
6 changed files with 78 additions and 3 deletions

View File

@@ -6,6 +6,18 @@ A utility types library for Typescript.
The types included in this library are categorized by their purpose.
#### Definition Types
| Type | Description |
| ---------------------- | -------------------------------------------------------------------- |
| [`Primitive`][] | A union of the primitive types of TypeScript. |
| [`BuiltIns`][] | A union of the built-in types of TypeScript. |
| [`NonContainerType`][] | A union of types, whose primary pourpose is not holding other types. |
[`Primitive`]: src/primitive.ts
[`BuiltIns`]: src/built-ins.ts
[`NonContainerType`]: src/non-container-type.ts
#### Test Types
| Type | Description |
@@ -36,9 +48,12 @@ The types included in this library are categorized by their purpose.
#### Conversion Types
| Type | Description |
| --------------------------------- | ------------------------------------------------------------------ |
| [`KeyPath<T, Separator = '.'>`][] | Converts a `Separator` separated string into a tuple of its parts. |
| Type | Description |
| --------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [`KeyPath<T, Separator = '.'>`][] | Converts a `Separator` separated string into a tuple of its parts. |
| [`Simplify<T, E, I>`][] | Maps types that extend `I` and not `E` to their properties. Helps diagnostic messages to be clearer. |
[`Simplify<T, E, I>`]: src/simplify.ts
#### Combination Types