@alphasquad/object-deep-compare
v0.0.1
Published
Deep compare two JSON objects.
Downloads
5
Readme
Deep compare
Compare javascript objects to determine whether they are an exact match or not.
Install
yarn add @alphasquad/object-deep-compare
Usage
const compare = require('@alphasquad/object-deep-compare')
// OR
import compare from '@alphasquad/object-deep-compare'
const obj1 = { hello: 'world' }
const obj2 = { hello: 'world' }
const compare = compare(obj1, obj2)
console.log(compare) // true
For strict comparison pass, true as third argument.
Example:
const compare = require('@alphasquad/object-deep-compare')
// OR
import compare from '@alphasquad/object-deep-compare'
const obj1 = { id: '1' }
const obj2 = { id: 1 }
const compare = compare(obj1, obj2, true)
console.log(compare) // false