Created
October 11, 2021 13:57
-
-
Save alienzhou/42d3a2237ba2ff6d7db55c1d7113e14e to your computer and use it in GitHub Desktop.
Utils in Typescript
This file contains hidden or 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
| // from https://gist.github.com/navix/6c25c15e0a2d3cd0e5bce999e0086fc9 | |
| export type DeepPartial<T> = T extends Function ? T : (T extends object ? { [P in keyof T]?: DeepPartial<T[P]>; } : T); | |
| export type DeepRequired<T> = T extends Function ? T : (T extends object ? { [P in keyof T]-?: DeepRequired<T[P]>; } : T); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment