Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/deep/deep.ts>Path.Result.For

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
type alias Path.Result.For
import { type Path } from "https://deno.land/x/rimbu@1.0.2/deep/deep.ts";
const { For } = Path.Result;

Determines the result type for an array of tokens representing subpaths in type T.

Type Parameters

T
Tokens
optional
Maybe extends boolean = Path.Internal.IsOptional<T>
definition: Tokens extends [] ? Path.Internal.MaybeValue<T, Maybe> : Path.Internal.IsOptional<T> extends true ? Path.Result.For<Exclude<T, undefined | null>, Tokens, Maybe> : Tokens extends ["?.", infer Key, ...infer Rest] ? Path.Result.For<Path.Result.Part<T, Key, Maybe>, Rest, true> : Tokens extends [".", infer Key, ...infer Rest] ? Path.Result.For<Path.Result.Part<T, Key, false>, Rest, Maybe> : Tokens extends [infer Key, ...infer Rest] ? Path.Result.For<Path.Result.Part<T, Key, false>, Rest, Maybe> : never