0.2.2 • Published 4 years ago

@gera2ld/deepdiff v0.2.2

Weekly downloads
18
License
MIT
Repository
-
Last release
4 years ago

@gera2ld/deepdiff

NPM License Downloads

Deep difference JSON objects.

Installation

$ yarn add @gera2ld/deepdiff

Usage

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',
}));
// -> []
0.2.2

4 years ago

0.2.1

4 years ago

0.1.2

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

5 years ago