@ianwalter/compare
v1.1.1
Published
A utility to calculate the match percentage and diff between two JavaScript objects
Downloads
4
Maintainers
Readme
@ianwalter/compare
A utility to calculate the match percentage and diff between two JavaScript objects
Installation
yarn add @ianwalter/compare
Usage
const compare = require('@ianwalter/compare')
const lhs = { a: 1, b: 2 }
const rhs = { a: 1, b: 3 }
const result = compare(lhs, rhs) // => {
// match: 75,
// diff: [{ kind: 'E', path: [ 'b' ], lhs: 2, rhs: 3 }]
// }
License
Apache 2.0 with Commons Clause - See LICENSE
Created by Ian Walter