Skip to main content
Module

x/fae/assocPath.ts>assocPath

A functional module for Deno inspired from Ramda.
Latest
variable assocPath
import { assocPath } from "https://deno.land/x/fae@v1.1.1/assocPath.ts";

Makes a shallow clone of an object, setting or overriding the nodes required to create the given path, and placing the specific value at the tail end of that path. Note that this copies and flattens prototype properties onto the new object as well. All non-primitive properties are copied by reference.

 Fae.assocPath(['a', 'b', 'c'], 42, {a: {b: {c: 0}}}); //=> {a: {b: {c: 42}}}
 Fae.assocPath(['a', 'b', 'c'], 42, {a: 5}); //=> {a: {b: {c: 42}}}

type

AssocPath