# are-shallow-equal

> Check if two values are shallowly equal to each other.

Latest version **2.0.2** (published 2025-01-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install are-shallow-equal
pnpm add are-shallow-equal
yarn add are-shallow-equal
bun add are-shallow-equal
```

## Health

**Score 50/100 (C)** — status: stable.

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

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2025-01-12 |
| First published | 2019-06-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | fabiospampinato |
| Keywords | check, shallow, equal |

## Links

- npm: https://www.npmjs.com/package/are-shallow-equal
- Repository: https://github.com/fabiospampinato/are-shallow-equal
- Homepage: https://github.com/fabiospampinato/are-shallow-equal#readme
- Issues: https://github.com/fabiospampinato/are-shallow-equal/issues
- npm.io page: https://npm.io/package/are-shallow-equal

## Recent versions

- 2.0.2 (latest) — 2025-01-12
- 2.0.1 — 2023-02-11
- 2.0.0 — 2022-05-06
- 1.1.1 — 2020-02-08
- 1.1.0 — 2019-08-19
- 1.0.0 — 2019-06-19

## README

# Are Shallow Equal

Check if two values are shallowly equal to each other.

## Install

```sh
npm install are-shallow-equal
```

## Usage

```ts
import areShallowEqual from 'are-shallow-equal';

// Let's compare two values for shallow equality

areShallowEqual ( 123, 123 ); // true
areShallowEqual ( { foo: 1 }, { foo: 1 } ); // true
areShallowEqual ( [1, 2, 3], [1, 2, 3] ); // true

areShallowEqual ( 123, 456 ); // false
areShallowEqual ( { foo: 1 }, { foo: 2 } ); // false
areShallowEqual ( [1, 2, 3], [1, 2] ); // false
```

## License

MIT © Fabio Spampinato

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