0.2.0 • Published 2 years ago
@n1ru4l/json-patch-plus v0.2.0
@n1ru4l/json-patch-plus
This is a slimmed version of jsondiffpatch. All the code is taken from the jsondiffpatch repository, slimmed down, slightly altered and converted to TypeScript.
Huge thanks to @benjamine, who did all the heavy work!
jsondiffpatch
is a replacement for json-patch
that produces more efficient patches!
@n1ru4l/json-patch-plus
has the following changes:
- Full ESM support
- Remove Node.js runtime dependencies introduced through loggers
- Remove class wrapper structures (make code less abstract and smaller)
- Remove text diffing
- Only generate and apply patch deltas (no reversing and visualization)
- Exclude unnecessary data from patch deltas (previous value is replaced with
null
)
For a full description of the delta format please refer to the jsondiffpatch
docs
Install Instructions
yarn install -E @n1ru4l/json-patch-plus
Usage
import { diff, patch } from "@n1ru4l/json-patch-plus";
const delta = diff({
left: {},
right: { a: { b: 1 } },
});
const result = patch({
left: {},
delta,
});
console.log(result);
// logs '{ a: { b: 1 } }'
0.2.0
2 years ago
0.2.0-alpha-1d12caa.0
2 years ago
0.2.0-alpha-3ae5051.0
2 years ago
0.1.4-alpha-eb167ab.0
3 years ago
0.1.4
3 years ago
0.1.3
3 years ago
0.1.2
3 years ago
0.1.1
3 years ago
0.1.0
3 years ago