Created
August 24, 2020 18:08
-
-
Save KEIII/d43d6363c4ce813f4a9ae9c0b5714d32 to your computer and use it in GitHub Desktop.
TypeScript extra types
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
export type RecursivePartial<T> = { | |
[P in keyof T]?: T[P] extends (infer U)[] | |
? RecursivePartial<U>[] | |
: T[P] extends object | |
? RecursivePartial<T[P]> | |
: T[P]; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment