Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mallusrgreatv2/object-difference
https://github.com/mallusrgreatv2/object-difference
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/mallusrgreatv2/object-difference
- Owner: mallusrgreatv2
- Created: 2024-02-27T09:22:32.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-03T09:02:51.000Z (10 months ago)
- Last Synced: 2024-11-14T20:51:53.695Z (about 1 month ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Object Difference
This package helps you get all (and only) the differences between two objects.
```ts
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:
```json
{
"test": {
"old": "abc",
"new": "123"
},
"three": {
"old": 4,
"new": 3
}
}
```