UniversalDataTool / seamless-immutable-patch

Execute JSON Patches on seamless-immutable objects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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,
  },
})


*/

About

Execute JSON Patches on seamless-immutable objects


Languages

Language:JavaScript 100.0%