utility-types
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -1,3 +0,3 @@ | ||
export { $Call, $Keys, $Values, $ReadOnly, $Diff, $PropertyType, $ElementType, } from './utility-types'; | ||
export { $Call, $Keys, $Values, $ReadOnly, $Diff, $PropertyType, $ElementType, $Shape, } from './utility-types'; | ||
export { Assign, DeepReadonly, DeepRequired, DeepNonNullable, Diff, FunctionKeys, Intersection, NonFunctionKeys, NonUndefined, Omit, Overwrite, PromiseType, SetComplement, SetDifference, SetIntersection, Subtract, SymmetricDifference, Unionize, } from './mapped-types'; | ||
export { getReturnOfExpression } from './functional-helpers'; |
@@ -11,1 +11,2 @@ import { SetComplement, DeepReadonly } from './mapped-types'; | ||
export declare type $Call<Fn extends (...args: any[]) => any> = Fn extends (arg: any) => infer RT ? RT : never; | ||
export declare type $Shape<T extends object> = Partial<T>; |
{ | ||
"name": "utility-types", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Utility Types Collection for TypeScript", | ||
@@ -5,0 +5,0 @@ "author": "Piotr Witek <piotrek.witek@gmail.com> (http://piotrwitek.github.io)", |
@@ -104,2 +104,3 @@ # utility-types | ||
* [`$Call<T>`](#callt) | ||
* [`$Shape<T>`](#shapet) | ||
@@ -673,2 +674,20 @@ ## Deprecated API (use at own risk) | ||
### `$Shape<T>` | ||
Copies the shape of the type supplied, but marks every field optional. | ||
https://flow.org/en/docs/types/utilities/#toc-shape | ||
**Usage:** | ||
```ts | ||
import { $Shape } from 'utility-types'; | ||
type Props = { name: string; age: number; visible: boolean }; | ||
type PartialProps = $Shape<Props>; | ||
// Expect: Partial<Props> | ||
``` | ||
[⇧ back to top](#flows-utility-types) | ||
--- | ||
@@ -675,0 +694,0 @@ |
Sorry, the diff of this file is not supported yet
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
24772
73
696