import type { AccessByPath, AccessPaths } from "../../../types/object"; export const access = >( obj: T, path: Path ): AccessByPath => // @ts-expect-error result and key cannot be inferred. (path as PropertyKey[]).reduce((prev, key) => Reflect.get(prev, key), obj);