Skip to content

UniversalDataTool/seamless-immutable-patch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

seamless-immutable-patch

npm version Test Status

Execute JSON Patches on seamless-immutable objects.

Installation

npm install seamless-immutable-patch

Usage

const immutable = require("seamless-immutable")
const seamlessImmutablePatch = require("seamless-immutable-patch")

const obj = immutable({
  a: 1,
  b: {
    c: 2,
  },
})

const patched = seamlessImmutablePatch(obj, [
  {
    op: "replace",
    path: "/b/c",
    value: 3,
  },
])

/*

> patched

immutable({
  a: 1,
  b: {
    c: 3,
  },
})


*/