1.0.5 • Published 1 year ago

deep-compare-objects v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Deep Compare Objects

Deep Compare Objects is a JavaScript module designed to deeply compare two JavaScript objects and identify their differences. It's lightweight, easy to use, and efficient for a wide range of use cases.

Features

  • Deep comparison of nested objects and arrays.
  • Detects added, removed, and changed properties.
  • Simple and intuitive API.
  • Lightweight and dependency-free.

Installation

You can install this module via npm:

npm install deep-compare-objects

or via yarn:

yarn add deep-compare-objects

Usage

Here's a quick example to get you started:

import deepCompareObjects from 'deep-compare-objects';

const a = { a: [1, 2, 3], b: { c: 1, d: 1 }, e: 'e', f: 'f', g: {} };
const b = { a: [3, 2, 1], b: { c: 1, d: 2 }, e: 'e', f: 'F', g: {} };

console.log(deepCompareObjects(a, b)); // { a: [ 3, <1 empty item>, 1 ], b: { d: 2 }, f: 'F' }

License

This project is licensed under the MIT License. See the LICENSE file for details.