aws-make-patch-operations

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i aws-make-patch-operations

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • toqoz