( object: ObjectType, path: Path, )
| 331 | |
| 332 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 333 | function get<ObjectType extends Record<string, any>, Path extends string>( |
| 334 | object: ObjectType, |
| 335 | path: Path, |
| 336 | ): ObjectPathValue<ObjectType, Path> { |
| 337 | return path.split('.').reduce<ObjectPathValue<ObjectType, Path>>((value, key) => { |
| 338 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 339 | return (value as any)[key] |
| 340 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 341 | }, object as any) |
| 342 | } |