Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/netzo/deps/react-hook-form.ts>PathValue

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Latest
type alias PathValue
import { type PathValue } from "https://deno.land/x/netzo@0.5.108/deps/react-hook-form.ts";

Type to evaluate the type which the given path points to.

Examples

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