@mallusrgreat/object-difference
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Object Difference

This package helps you get all (and only) the differences between two objects.

import { objectDifference } from "@mallusrgreat/object-difference";
// or
const { objectDifference } = require("@mallusrgreat/object-difference");

console.log(
  objectDifference(
    {
      test: "abc",
      one: 1,
      three: 4,
    },
    {
      test: "123",
      one: 1,
      three: 3,
    }
  )
);

Logs:

{
  "test": {
    "old": "abc",
    "new": "123"
  },
  "three": {
    "old": 4,
    "new": 3
  }
}

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @mallusrgreat/object-difference

      Weekly Downloads

      41

      Version

      1.0.2

      License

      MIT

      Unpacked Size

      2.58 kB

      Total Files

      7

      Last publish

      Collaborators

      • mallusrgreat