object-help

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i object-help

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

4.41 kB

Total Files

6

Last publish

Collaborators

  • edisoncury