@firoxer/minimal-json-patch

1.0.2 • Public • Published

minimal-json-patch

An implementation of RFC 6902 without bells or whistles.

Usage

import { applyPatch } from 'minimal-json-patch';

const originalDocument = {
  letters: ['a', 'b', 'd'],
};

const modifiedDocument = applyPatch(originalDocument, [
  { op: 'add', path: '/letters/2', value: 'c' },
]);

console.log(modifiedDocument.letters);
// [ 'a', 'b', 'c', 'd' ]

To-Do

  • Clearer error messages
  • More consistent error messages

Readme

Keywords

Package Sidebar

Install

npm i @firoxer/minimal-json-patch

Weekly Downloads

17

Version

1.0.2

License

MIT

Unpacked Size

87.4 kB

Total Files

16

Last publish

Collaborators

  • firoxer