immutablepatch2

0.5.2 • Public • Published

Immutable Patch 2

extends immutablepatch@0.5.0

fix: Remove the exception that an empty object property value becomes null

====

Apply RFC 6902 style patches to Immutable.JS data structures, such as Maps, Lists, and Sets.

Getting Started

You may get the module via npm:

npm install immutablepatch

And apply JSON patches to an immutable JSON object:

var Immutable = require('immutable');
var patch = require('immutablepatch');
 
var list = Immutable.fromJS([1, 2, [3, 4]]);
var ops = Immutable.fromJS([
  {op: 'replace', path: '/2/1', value: 10}
]);
 
var result = patch(list, ops);
// var expected = Immutable.fromJS([1, 2, [3, 10]]);

You will probably need immutablediff to generate diff operations.

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i immutablepatch2

    Weekly Downloads

    0

    Version

    0.5.2

    License

    MIT

    Unpacked Size

    30.5 kB

    Total Files

    16

    Last publish

    Collaborators

    • wangtap