https://github.com/gera2ld/deepdiff
Deep difference JSON objects
https://github.com/gera2ld/deepdiff
Last synced: 6 months ago
JSON representation
Deep difference JSON objects
- Host: GitHub
- URL: https://github.com/gera2ld/deepdiff
- Owner: gera2ld
- License: mit
- Created: 2020-08-21T18:13:41.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-12T10:07:46.000Z (over 1 year ago)
- Last Synced: 2025-09-23T19:40:32.208Z (10 months ago)
- Language: TypeScript
- Size: 125 KB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @gera2ld/deepdiff



Deep difference JSON objects.
## Installation
```sh
$ yarn add @gera2ld/deepdiff
```
## Usage
```js
import { deepdiff } from '@gera2ld/deepdiff';
console.log(deepdiff({
a: [1, 2, 3, 5],
b: 1,
}, {
a: [2, 3, 4, 5],
b: 2,
}));
// -> [
// { op: 'delete', path: '/a/0', oldVal: 1 },
// { op: 'insert', path: '/a/3', newVal: 4 },
// { op: 'replace', path: '/b', oldVal: 1, newVal: 2 },
// ]
// Custom hashObject
console.log(deepdiff({
a: [1, 2, 3, 5],
b: 1,
}, {
a: [2, 3, 4, 5],
b: 2,
}, {
hashObject: () => 'all same hash',
}));
// -> []
```