@firoxer/minimal-json-patch
v1.0.2
Published
Minimal implementation of JSON Patch (RFC 6902) in JavaScript
Downloads
3
Readme
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