Skip to content

Commit

Permalink
feat(types): Simplify
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <[email protected]>
  • Loading branch information
unicornware committed Nov 23, 2022
1 parent 5a6fe9b commit 29d5151
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export type { default as Predicate } from './predicate'
export type { default as Primitive } from './primitive'
export type { default as Promisable } from './promisable'
export type { default as SemanticVersion } from './semantic-version'
export type { default as Simplify } from './simplify'
export type { default as Split } from './split'
export type { default as StringLike } from './string-like'
export type { default as TimestampUnix } from './timestamp-unix'
17 changes: 17 additions & 0 deletions src/types/simplify.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @file Type Definitions - Simplify
* @module tutils/types/Simplify
*/

/**
* Simplifies a complex type.
*
* Useful for improving IDE type hints and transforming interfaces into types.
*
* @see https://github.com/microsoft/TypeScript/issues/15300
*
* @template T - Complex type
*/
type Simplify<T> = { [K in keyof T]: T[K] }

export type { Simplify as default }

0 comments on commit 29d5151

Please sign in to comment.