Skip to main content
Module

x/rimbu/mod.ts>Deep.Path.Result.For

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
type alias Deep.Path.Result.For
import { type Deep } from "https://deno.land/x/rimbu@0.14.0/mod.ts";
const { For } = Deep.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