is-object-equal
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

Installations

npm i is-object-equal

What ?

An module to check if the provided two objects are equal or not

Why ?

  • Fast
  • Customizable

How ?

// Importing for Node JS
const isEqual = require('is-object-equal').default;

// Importing for TypeScript / vanilla JavaScript
import isEqual from 'is-object-equal';

const ob1 = {
    name:"Shisui",
    hobby:["coding"],
    address: {
        city:"unknown",
        country:"india",
    }
}

const ob2 = {
    name:"Shisui",
    hobby:["Coding"], // C is capital
    address: {
        city:"unknown",
        country:"india",
    }
}

const ob3 = {
    name:"Shisui",
    hobby:["coding"],
    address: {
        city:"unknown",
        country:"india",
    },
    number:12345678,
}

console.log(isEqual(ob1, ob1)); // => true

console.log(isEqual(ob1, ob2)); // => false

console.log(isEqual(ob1, ob2, { ignoreCase:true })); // => true

// False because it have a extra property
console.log(isEqual(ob1, ob3)); // => false

console.log(isEqual(ob1, ob3, { allowExtra:true })); // => true

Support

for support or issues or queries contace me on my discord server or create a issue here.

Readme

Keywords

Package Sidebar

Install

npm i is-object-equal

Weekly Downloads

0

Version

1.2.1

License

ISC

Unpacked Size

5.3 kB

Total Files

5

Last publish

Collaborators

  • shisui