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

x/rimbu/deep/path.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@0.13.5/deep/path.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