# @codefeathers/iseq

> Deep compare objects and arrays

Latest version **1.2.1** (published 2018-05-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @codefeathers/iseq
pnpm add @codefeathers/iseq
yarn add @codefeathers/iseq
bun add @codefeathers/iseq
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2018-05-12 |
| First published | 2018-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 130.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Muthu Kumar |
| Maintainers | mkrhere |
| Keywords | isEqual, number, string, object, array, null, regexp, deep-compare |

## Links

- npm: https://www.npmjs.com/package/@codefeathers/iseq
- Repository: https://github.com/codefeathers/isEq
- Homepage: https://github.com/codefeathers/isEq#readme
- Issues: https://github.com/codefeathers/isEq/issues
- npm.io page: https://npm.io/package/@codefeathers/iseq

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2018-05-12
- 1.2.0 — 2018-05-12
- 1.1.0 — 2018-03-09
- 1.0.4 — 2018-03-09
- 1.0.3 — 2018-03-08
- 1.0.2 — 2018-02-27
- 1.0.1 — 2018-02-27
- 1.0.0 — 2018-02-27

## README

# ≡

### isEq -- Deep-compare objects

`isEq` is a very tiny module that deep compares objects or arrays.

Although its intention is deep comparison, `isEq` can compare several datatypes.

## Supports

| Datatype             	| Support	|
|---------------------	|---		|
| Number              	| ✅ 	|
| String              	| ✅ 	|
| Boolean             	| ✅ 	|
| Object              	| ✅ 	|
| Array               	| ✅ 	|
| Cyclic Object/Array 	| ✅ 	|
| Regexp              	| ✅ 	|
| Function            	| ✅ 	|
| Symbol              	| ✅ 	|

> Note: functions and symbols are compared by identity. Regexp is stringified before comparison.
> Unhandleable inputs fall back to strict equality (`===`)

## Installation

Node:

```Shell
npm install --save @codefeathers/iseq
```

In the browser:
```HTML
<script src="https://unpkg.com/@codefeathers/iseq">
```

## Usage

```JavaScript
isEq(<sourceObject>, <compareObject>, [comparisonKeys])
```

where if comparison keys are not given, `compareObject` is compared against all keys of `sourceObject`.

## Example

So you want to filter all the entities in `Steins;Gate` that have the property `isEvil: true`.

```JavaScript
var entities = [
	{
		name: 'Future Gadget Laboratory',
		isEvil: false,
		after: 'Disrupting the status quo',
		"known-members": [
			{ name: 'Okabe Rintarou', gender: 'Male', occupation: 'University student' },
			{ name: 'Mayuri Shiina', gender: 'Female', occupation: 'Maid at May Queen' },
			{ name: 'Itaru Hashida', gender: 'Male', occupation: 'Hacker' },
		],
	},
	{
		name: 'SERN',
		isEvil: true,
		after: 'IBN 5100',
		"known-members": [
			{ name: 'Yuugo Tennouji', gender: 'Male', occupation: 'CRT mechanic' },
			{ name: 'Moeka Kiryū', gender: 'Female', occupation: 'Part-time editor' },
		],
	},
	{
		name: 'Strategic Focus',
		isEvil: true,
		after: 'Time travel',
		"known-members": [
			{ name: 'Alexis Leskinen', gender: 'Male', occupation: 'Professor' },
		],
	},
]

const evilEntities = entities.filter(eachEntity => isEq(eachEntity, { isEvil: true }, ['isEvil']));
```
<br><br>

***Written by [@MKRhere](https://mkr.pw)*** —

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