# is-objects-equal

> function for compare not deep and deep object, not support compare Map and Set objects

Latest version **1.0.0** (published 2021-09-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-objects-equal
pnpm add is-objects-equal
yarn add is-objects-equal
bun add is-objects-equal
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-09-20 |
| First published | 2021-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 32.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | webster6667 |
| Maintainers | webster6667 |

## Links

- npm: https://www.npmjs.com/package/is-objects-equal
- Repository: https://github.com/webster6667/is-objects-equal
- Homepage: https://github.com/webster6667/is-objects-equal#readme
- Issues: https://github.com/webster6667/is-objects-equal/issues
- npm.io page: https://npm.io/package/is-objects-equal

## Dependencies (1)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.14.0

## Recent versions

- 1.0.0 (latest) — 2021-09-20

## README

<p align="center" style="text-align:center">
    <img src="./illustration.svg" alt="illustration" width="100"/>
</p>

# is-objects-equal

> function for compare not deep and deep object, not support compare Map and Set objects

[![npm version](https://badge.fury.io/js/is-objects-equal.svg)](https://www.npmjs.com/package/is-objects-equal)
[![](https://data.jsdelivr.com/v1/package/npm/is-objects-equal/badge)](https://www.jsdelivr.com/package/npm/is-objects-equal)


## Table of Contents

- [Quick start](#quick-start)
  - [Install](#install)
  - [Initialization](#initialization)
- [Methods](#methods)
  - [isObjectsEqual](#isObjectsEqual)

## Quick start

### Install

We support all platforms.

#### npm

For module bundlers such as Webpack or Browserify.

```shell
npm i is-objects-equal
```

#### Include with &lt;script&gt;

1. <a href="https://cdn.jsdelivr.net/npm/is-objects-equal/dist/lib/is-objects-equal.js" target="_blank">Download lib</a>
2. Add script to html

```html
<script src="is-objects-equal.js"></script>
```

##### CDN

Recommended for learning purposes, you can use the latest version:

```html
<script src="https://cdn.jsdelivr.net/npm/is-objects-equal/dist/lib/is-objects-equal.js"></script>
```

Recommended for production for avoiding unexpected breakage from newer versions:

```html
<script src="https://cdn.jsdelivr.net/npm/is-objects-equal@0.0.0/dist/lib/is-objects-equal.js"></script>
```

### Initialization

#### ES6

is-objects-equal as an ES6 module.

```js
import isObjectsEqual from 'is-objects-equal';

isObjectsEqual([{a: 1}, {a: 1}])

```

#### Node

is-objects-equal as a Node.js module

```js
const isObjectsEqual = require('is-objects-equal');

isObjectsEqual([{a: 1}, {a: 1}])
```

#### Browser

Exports a global variable called `isObjectsEqual`. Use it like this

Connect to html file ```<script src="https://cdn.jsdelivr.net/npm/is-objects-equal/dist/lib/is-objects-equal.js" ></script>```

```html
<script>
    isObjectsEqual([{a: 1}, {a: 1}]);
</script>
```

#### AMD

is-objects-equal as an AMD module. Use with Require.js, System.js, and so on.

1. <a href="https://cdn.jsdelivr.net/npm/is-objects-equal/dist/lib/is-objects-equal.js" target="_blank">Download lib</a>
2. Connect to your module loader

```js
requirejs(['is-objects-equal'], function(isObjectsEqual) {
    isObjectsEqual([{a: 1}, {a: 1}])
});
```

## Methods

### isObjectsEqual

function for compare not deep and deep object, not support compare Map and Set objects


#### Params
- `objectsArray`
  - Type: `Array`
  

#### Returns
- `boolean`

#### Example
```JS
isObjectsEqual([{a: '1'}, {a: '1'}])
// => true

isObjectsEqual([{a: '1'}, {a: '2'}
// => false

isObjectsEqual([{a: '1'}, {a: '1'}, {a: '2'}])
// => false

const firstObject = {
    a: 1,
    b: {
        c: 1
    }
},
secondObject = {
    a: 1,
    b: {
        c: 2
    }
}

isObjectsEqual([firstObject, secondObject])
// => false
```



## Author

webster6667

---
_Source: https://npm.io/package/is-objects-equal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
