Created
May 2, 2022 13:01
-
-
Save jasonbyrne/eb64b112f259bd66949d5889562ca040 to your computer and use it in GitHub Desktop.
DeepPartial in TypeScript
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
export type DeepPartial<T> = T extends Function | |
? T | |
: T extends object | |
? { [P in keyof T]?: DeepPartial<T[P]> | undefined } | |
: T | undefined; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment