Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakejarrett/compare
Minimal recursive object comparison function
https://github.com/jakejarrett/compare
Last synced: 22 days ago
JSON representation
Minimal recursive object comparison function
- Host: GitHub
- URL: https://github.com/jakejarrett/compare
- Owner: jakejarrett
- Created: 2017-06-15T21:54:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-10T09:15:06.000Z (over 7 years ago)
- Last Synced: 2024-11-02T00:22:32.080Z (2 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Compare
* **Tiny** Unminified filesize is ~410 bytes
* **Easy to use** Simply call `compare(object, object)`## API
### ES6
```js
import compare from '@jakejarrett/compare'const firstObject = {
hello: {
yes: true,
no: false
},
user: {
name: 'jake',
id: 0
}
}const secondObject = Object.assign({}, firstObject)
// true
compare(firstObject, secondObject)secondObject.user.name = 'not jake'
secondObject.user.id = 1// false
compare(firstObject, secondObject)```