-
-
Save scottshane/9f358fb8c989d52ca55ed34eaabc35c2 to your computer and use it in GitHub Desktop.
NestedKeyOf
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
type NestedKeyOf<ObjectType extends object> = | |
{[Key in keyof ObjectType & (string | number)]: ObjectType[Key] extends object | |
? `${Key}` | `${Key}.${NestedKeyOf<ObjectType[Key]>}` | |
: `${Key}` | |
}[keyof ObjectType & (string | number)]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment