Skip to main content
Module

x/rimbu/deep/mod.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@0.11.6/deep/mod.ts";

Functions

Returns true if the given value object matches the given matcher, false otherwise.

Returns a matcher that returns true if every given matchItem matches the given value.

Returns a matcher that returns true if none of given matchItem matches the given value.

Returns a matcher that returns true if exactly one of given matchItem matches the given value.

Returns a matcher that returns true if at least one of given matchItem matches the given value.

Returns an immutably updated version of the given value where the given patchItems have been applied to the result.

Returns a function that patches a given value with the given patchItems.

Returns a nested patch object based on the given patchDataItems that work on a subpart of a larger object to be patched.

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.

Returns the same value wrapped in the Protected type.

Returns the given tuple with the given values appended.

Returns a Tuple containing the elements of given tuple1 followed by the elements of given tuple2.

Returns the first element of a Tuple.

Returns the item at the given index in the givn tuple.

Returns a Tuple containing all but the last element of the given tuple.

Returns the last element of a Tuple.

Convenience method to type Tuple types

Returns the second element of a Tuple.

Returns a Tuple containing all but the first element of the given tuple.

Returns a copy of the given tuple where the element at given index is updated with the given updater.

Type Aliases

The type to determine the allowed input values for the match functions.

The functions that are optionally provided to a match function.

The type to determine allowed matchers for objects.

The type to determine allowed matchers for object properties.

The types of supported match input.

A type to determine the allowed input type for the patch function.

The entry type for a (nested) patch. Can be either a patch object or a function accepting the nested patch function and returning a patch object.

The function type to create a nested Patch object.

The object patch type, allows the user to specify keys in T that should be patched, and each given key contains either a new value or a nested patch, or a function receiving the current value, the parent object, and the root object, and returning a new value or a nested patch.

A patch object can have as update either a new value or a nested patch object

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

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

A deep readonly typed version of given type T. Makes all properties or elements read only. It maps types using the following rules:

  • arrays and tuples become readonly counterparts, and all element types are wrapped in Protected if applicable
  • Maps of key type K and value type V become Maps of key type Protected<K> and value type Protected<V>
  • Sets of element type E become Sets of element type Protected<E>
  • Promises of value type E become Promises of value type Protected<E>
  • Objects that have only simple properties (no functions or iterators) will have all the properties as Protected if applicable
  • Any other type will not be mapped

A readonly array of fixed length and types.

A non-empty readonly array that can serve as a source for a Tuple.

A readonly array that can serve as a source for a Tuple.