Skip to main content
Module

x/rimbu/mod.ts>patchNested

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

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

Examples

Example 1

patch({ a: 1, b: { c: true, d: 'a' } }, { b: patchNested({ d: 'b' }) })
// => { a: 1, b: { c: true, d: 'b' } }

Type Parameters

T
R
optional
Q extends T = T

Parameters

...patchDataItems: Patch.Obj<Q, R>[]
  • a number of Patch objects to be applied to the subpart of the object

Returns

NestedObj<T, R, Q>