-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ts): Improve types for strict mode.
- Loading branch information
1 parent
6d5255d
commit a1098a1
Showing
2 changed files
with
94 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Taken from ts-essentials | ||
* @link https://github.com/krzkaczor/ts-essentials/blob/master/lib/types.ts#L9 | ||
*/ | ||
type DeepPartial<T> = { | ||
[P in keyof T]?: T[P] extends Array<infer U> | ||
? Array<DeepPartial<U>> | ||
: T[P] extends ReadonlyArray<infer X> | ||
? ReadonlyArray<DeepPartial<X>> | ||
: DeepPartial<T[P]> | ||
}; | ||
|
||
export default DeepPartial; |