aws-make-patch-operations
v1.0.1
Published
makes patchOperations from 2 objects
Downloads
3
Readme
make-patch-operations
makes patchOperations from 2 objects.
Usage
example.js:
var makePatchOperations = require('aws-make-patch-operations');
var oldObj = {
a: {_a: '_x'},
b: {_b: 2}
};
var newObj = {
a: {_a: '_y'},
b: {_b: 3}
};
var operations = makePatchOperations(oldObj, newObj)
console.dir(operations);
$ node ./example.js
[ { op: 'replace', path: '/a/_a', value: '_y' },
{ op: 'replace', path: '/b/_b', value: '3' } ]
Supported operations
- add
- remove
- replace