type-fest
Advanced tools
Comparing version 1.2.3 to 1.3.0
@@ -38,2 +38,3 @@ // Types that are compatible with all supported TypeScript versions. | ||
export {Asyncify} from './source/asyncify'; | ||
export {Simplify} from './source/simplify'; | ||
@@ -40,0 +41,0 @@ // Miscellaneous |
{ | ||
"name": "type-fest", | ||
"version": "1.2.3", | ||
"version": "1.3.0", | ||
"description": "A collection of essential TypeScript types", | ||
@@ -5,0 +5,0 @@ "license": "(MIT OR CC0-1.0)", |
@@ -122,2 +122,3 @@ <div align="center"> | ||
- [`Asyncify`](source/asyncify.d.ts) - Create an async version of the given function type. | ||
- [`Simplify`](source/simplify.d.ts) - Flatten the type output to improve type hints shown in editors. | ||
@@ -124,0 +125,0 @@ ### Template literal types |
/** | ||
Flatten the type output to improve type hints shown in editors. | ||
@example | ||
``` | ||
import {Simplify} from 'type-fest'; | ||
type PositionProps = { | ||
top: number; | ||
left: number; | ||
}; | ||
type SizeProps = { | ||
width: number; | ||
height: number; | ||
}; | ||
// In your editor, hovering over `Props` will show a flattened object with all the properties. | ||
type Props = Simplify<PositionProps & SizeProps>; | ||
``` | ||
@category Utilities | ||
*/ | ||
export type Simplify<T> = {[KeyType in keyof T]: T[KeyType]}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
135427
2979
794