type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; type Path = [D] extends [never] ? never : T extends (infer U)[] ? `${number}` | `${number}.${Path}` : T extends object ? { [K in keyof T & (string | number)]: `${K}` | `${K}.${Path}`; }[keyof T & (string | number)] : never; declare class ObjectUtils { /** * Internal helper to resolve deep values, including array indices. * Works for paths like "users.0.name" or "tags.1". */ private static getDeepValue; /** * Converts an array to a Map, extracting a specific deep property for the value. * @param array The source array * @param keyPath The deep path for the Map key * @param valuePath The deep path for the Map value (defaults to the whole object) */ static arrayToMap(array: T[], keyPath: Path, valuePath?: Path): Map; /** * Groups an array of objects by a deep path. * @example * * interface User { id: number; profile: { name: string; email: string }; settings: { theme: 'dark' | 'light' }; } const users: User[] = [ { id: 1, profile: { name: 'Alice', email: 'a@ex.com' }, settings: { theme: 'dark' } }, { id: 2, profile: { name: 'Bob', email: 'b@ex.com' }, settings: { theme: 'light' } } ]; // Map ID to just the Email string // Result: Map const emailMap = ObjectUtils.arrayToMap(users, 'id', 'profile.email'); console.log(emailMap.get(1)); // "a@ex.com" // Group IDs by their Theme // Result: Map const idsByTheme = ObjectUtils.arrayToGroupMap(users, 'settings.theme', 'id'); console.log(idsByTheme.get('dark')); // [1] * * * Groups an array into a Map of arrays, extracting a specific deep property for values. */ static arrayToGroupMap(array: T[], keyPath: Path, valuePath?: Path): Map; } //# sourceMappingURL=_ObjectUtil.d.ts.map