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

x/rimbu/deep/path.ts

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
import * as rimbu from "https://deno.land/x/rimbu@1.0.2/deep/path.ts";

Variables

Regular expression used to split a path string into tokens.

Functions

Returns the value resulting from selecting the given path in the given source object. It supports optional chaining for nullable values or values that may be undefined, and also for accessing objects inside an array. There is currently no support for forcing non-null (the ! operator).

Patches the value at the given path in the source to the given value. Because the path to update must exist in the source object, optional chaining and array indexing is not allowed.

Return the given path string split into an array of subpaths.

Type Aliases

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

Utility type to only add non-empty string types to a string array.

Determines the allowed paths for an array.

Determines the allowed paths into a value of type T.

Determines whether the given type T is optional, that is, whether it can be null or undefined.

Returns type T if Maybe is false, T | undefined otherwise.

Determines the allowed non-empty paths into a value of type T.

Determines the allowed paths into a non-optional value of type T.

Determines the allowed paths for an object.

Determines the allowed path part seperator based on the input types.

Determines the allowed paths for a tuple. Since tuples have fixed types, they do not need to be optional, in contrast to arrays.

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

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

Determines the result of getting the property/index K from type T, taking into account that the value may be optional.

Converts a path string into separate tokens in a string array.

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

The allowed values of a split path.