# @sharyn/util.either

> **`either`** returns `true` if the first argument equals any of the other arguments.

Latest version **1.0.1** (published 2019-09-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sharyn/util.either
pnpm add @sharyn/util.either
yarn add @sharyn/util.either
bun add @sharyn/util.either
```

## 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.0.1 |
| Published | 2019-09-07 |
| First published | 2019-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 29 |
| Maintainers | sharyn |

## Links

- npm: https://www.npmjs.com/package/@sharyn/util.either
- Repository: https://github.com/sharynjs/sharyn
- Homepage: https://github.com/sharynjs/sharyn/tree/master/packages/util.either
- Issues: https://github.com/sharynjs/sharyn/issues
- npm.io page: https://npm.io/package/@sharyn/util.either

## Dependencies (1)

- [lodash.isequal](https://npm.io/package/lodash.isequal.md) 4.5.0

## Recent versions

- 1.0.1 (latest) — 2019-09-07
- 1.0.0 — 2019-09-07

## README

# 🌹 either

**`either`** returns `true` if the first argument equals any of the other arguments.

Basically, you can replace this:

```js
if (something === 'foo' || something === 'bar' || something === 'baz')
// or
if (['foo', 'bar', 'baz'].includes(something))
```

By this:

```js
import either from '@sharyn/util/either'
// or import { either } from '@sharyn/util'

if (either(something, 'foo', 'bar', 'baz'))
```

`either` uses deep equality so you can test objects as well:

```js
either(obj, { a: 1 }, { a: 2 })
```

**`either`** is part of [`@sharyn/util`](https://github.com/sharynjs/sharyn-util/blob/master/README.md)

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