1.0.1 • Published 6 years ago
object-help v1.0.1
Object Utils
Installation
$ cd into-your-project-root
$ npm install object-help --save
Code Example
objectsAreEqual(objectsArray!, options? = {sorted : boolean})
// Sorted object is enabled by default
const { objectsAreEqual } = require('object-help');
const equalSorted = objectsAreEqual([{a: 'b', b: 'a'}, {b: 'a', a: 'b'])
console.log(equalSorted) // returns true
const equalUnsortedFalse = objectsAreEqual([{a: 'b', b: 'a'}, {b: 'a', a: 'b'}], {sorted: false})
console.log(equalUnsortedFalse) // returns false
const equalUnsortedTrue = objectsAreEqual([{a: 'b', b: 'a'}, {a: 'b', b: 'a'}], {sorted: false})
console.log(equalUnsortedTrue) // returns true
Tests (Jest)
$ cd into-your-project-root
$ npm i
$ npm test
Author
Edison Cury Neto
License
MIT