Execute JSON Patches on seamless-immutable objects.
npm install seamless-immutable-patch
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,
},
})
*/