Skip to main content
Module

x/rimbu/mod.ts>Path.setValue

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

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

Examples

Example 1

console.log(Path.setValue({ a: { b: { c: 5  } } }))

Type Parameters

T
optional
P extends Path<T> = Path<T>

Parameters

source: T
  • the object to update
path: P
  • the path in the object to update
value: Path.Result<T, P>
  • the new value to set at the given position