Skip to main content
Module

x/rimbu/mod.ts>Path

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
namespace Path
import { Path } from "https://deno.land/x/rimbu@0.11.6/mod.ts";

Functions

Returns the value resulting from selecting the given path in the given source object.

Sets the value at the given path in the source to the given value.

Type Aliases

The result type when selecting from object type T a path with type P.

type alias Path
import { type Path } from "https://deno.land/x/rimbu@0.11.6/mod.ts";

A string representing a path into an (nested) object of type T.

Examples

Example 1

const p: Path<{ a: { b: { c : 5 }}}> = 'a.b'
definition: IsPlainObj<T> extends true ? [K in string & keyof T]: `${K}` | `${K}.${Path<T[K]>}`[string & keyof T] : never