import { type PathValue } from "https://deno.land/x/netzo@0.3.91/deps/react-hook-form.ts";
Type to evaluate the type which the given path points to.
Examples
Example 1
Example 1
PathValue<{foo: {bar: string}}, 'foo.bar'> = string
PathValue<[number, string], '1'> = string
definition: T extends any ? P extends `${infer K}.${infer R}` ? K extends keyof T ? R extends Path<T[K]> ? PathValue<T[K], R> : never : K extends `${ArrayKey}` ? T extends ReadonlyArray<infer V> ? PathValue<V, R & Path<V>> : never : never : P extends keyof T ? T[P] : P extends `${ArrayKey}` ? T extends ReadonlyArray<infer V> ? V : never : never : never