Generates all possible dot-separated key paths from a nested object type. Returns a union of all valid key paths as string literals.
The object to extract paths from
The accumulated path (used for recursion)
type Obj = { user: { profile: { name: string; }; }; age: number;};type P = Paths<Obj>;// Result:// 'user'// 'user.profile'// 'user.profile.name'// 'age' Copy
type Obj = { user: { profile: { name: string; }; }; age: number;};type P = Paths<Obj>;// Result:// 'user'// 'user.profile'// 'user.profile.name'// 'age'
Generates all possible dot-separated key paths from a nested object type. Returns a union of all valid key paths as string literals.