Skip to main content

Type Alias: NestedKeys<T, Depth>

NestedKeys<T, Depth>: Depth extends never ? never : { [K in keyof T]: undefined extends T[K] ? `${K & string}` | `${K & string}.${NestedKeys<NonNullable<T[K]>, DecrementDepth[Depth]>}` : T[K] extends any[] ? `${K & string}` : T[K] extends object ? `${K & string}` | `${K & string}.${NestedKeys<T[K], DecrementDepth[Depth]>}` : `${K & string}` }[keyof T]

Type Parameters

T

Depth extends number = 5