Created
June 15, 2022 15:00
-
-
Save tusharsnx/bc895619cb0d6a709664860593de8c43 to your computer and use it in GitHub Desktop.
Apply Partial Recursively on Object Types
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
type PartialRecur<T> = T extends {} ? { [K in keyof T]?: PartialRecur<T[K]> } : T |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Applies
Partial
recursively to all the key's value.example:
Use-Case: