object-equals
Deep compare two objects to check if they are equal
Installation
npm
npm install object-equals
yarn
yarn add object-equals
Example Usage
// Or// import objectEquals from 'object-equals'// Or// var { objectEquals } = require('object-equals') const obj1 = a: 1 c: a: 11 d: {} const obj2 = a: 1 c: a: 11 d: {}
Options
depth
- Level of deep comparison, after which no deep comparison is done
const obj1 = a: 1 b: c: '2' const obj2 = a: 1 b: c: '3'
keysOnly
- if true, only keys will be compared irrespective of the values
const obj1 = a: 1 b: c: '2' const obj2 = a: 1 b: c: '3'
valuesOnly
- if true, only values will be compared irrespective of the keys
const obj1 = a: 1 b: c: '2' const obj2 = aaa: 1 bbbb: cccc: '2'