# @writetome51/array-has

> All these functions check the contents of the passed array and return boolean.

Latest version **3.0.0** (published 2021-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @writetome51/array-has
pnpm add @writetome51/array-has
yarn add @writetome51/array-has
bun add @writetome51/array-has
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-11-08 |
| First published | 2018-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Steve Thompson |
| Maintainers | writetome51 |
| Keywords | array, check, contains, has, includes, boolean, contents, manipulation |

## Links

- npm: https://www.npmjs.com/package/@writetome51/array-has
- Repository: https://github.com/writetome51/array-has
- Homepage: https://github.com/writetome51/array-has#readme
- Issues: https://github.com/writetome51/array-has/issues
- npm.io page: https://npm.io/package/@writetome51/array-has

## Dependencies (5)

- [@writetome51/not](https://npm.io/package/@writetome51/not.md) >=2.0.0
- [@writetome51/is-match](https://npm.io/package/@writetome51/is-match.md) >=0.0.1
- [@writetome51/is-array-not-array](https://npm.io/package/@writetome51/is-array-not-array.md) >=2.0.0
- [@writetome51/is-empty-not-empty](https://npm.io/package/@writetome51/is-empty-not-empty.md) >=2.0.1
- [@writetome51/array-get-indexes-of](https://npm.io/package/@writetome51/array-get-indexes-of.md) >=2.0.1

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2021-11-08
- 2.0.2 — 2020-09-08
- 2.0.1 — 2020-08-29
- 2.0.0 — 2020-08-03
- 1.0.8 — 2019-04-14
- 1.0.7 — 2019-02-26
- 1.0.6 — 2018-12-05
- 1.0.5 — 2018-10-25
- 1.0.4 — 2018-10-23
- 1.0.3 — 2018-10-22
- 1.0.2 — 2018-10-17
- 1.0.1 — 2018-10-11
- 1.0.0 — 2018-10-09

## README

# has(value, array): boolean

Returns true if `value` is found in `array`.

# hasAll(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;values: any[],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array<br>): boolean

Returns true if all `values` are found in `array`.

# hasAny(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;values: any[],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array<br>): boolean

Returns true if at least 1 value in `values` is found in `array`.

# hasAdjacent(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;values: any[],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array<br>): boolean

Returns true if `array` contains exact sequence of `values`.


## Examples
```js
has(1, [1,2,3]); // --> true

// Notice that arrays don't need to be identical via `===` to match:
has(
    [2,3],
    [1, [2,3], 4, 5]
);
// --> true

// Objects do need to be identical via `===` to match:
has(
    {name: 'joe'},
    [1, 2, 3, {name: 'joe'}]
);
// --> false

let obj =  {name: 'joe'};
has(
    obj,
    [1, 2, 3, obj]
);
// --> true

has(
    [2, 3],
    [1, 2, 3, 4, 5]
);
// --> false

hasAdjacent(
    [2, 3],
    [1, 2, 3, 4, 5]
);
// --> true

hasAdjacent(
    ['a','b','c'],
    ['a','b','d','c']
);
// --> false


hasAny(
    ['d', 'a'], 
    ['a', 'bb', 'c', 'cc']
);
// --> true

hasAny(
    ['d', 'a'], 
    ['aaa', 'bb', 'c', 'cc']
);
// --> false

hasAll(
    [1, 3, 5],
    [1, 2, 3, 4, 5, 6, 7]
);
// --> true

hasAll(
    [1, 3, 5],
    [1, 2, 3, 4, 6, 7]
);
// --> false
```


## Installation
`npm i  @writetome51/array-has`


## Loading
```js
import {has, hasAll, hasAny, hasAdjacent} 
    from '@writetome51/array-has';
```

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