Created
November 9, 2022 08:20
-
-
Save 8mist/a04cbae774f78b1e53db5335d4b086f8 to your computer and use it in GitHub Desktop.
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 RecursiveKeyOf< | |
TObj, | |
TPrefix extends string = '' | |
> = TObj extends Record<string, any> | |
? { | |
[K in keyof TObj & string]: | |
| `${TPrefix}${K}` | |
| RecursiveKeyOf<TObj[K], `${TPrefix}${K}.`>; | |
}[keyof TObj & string] | |
: never; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment