# has-subarrays

> Quickly Determine if an Array contains Subarrays

Latest version **0.0.2** (published 2020-11-17) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install has-subarrays
pnpm add has-subarrays
yarn add has-subarrays
bun add has-subarrays
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-11-17 |
| First published | 2020-11-15 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniel J. Dufour |
| Maintainers | danieljdufour |
| Keywords | array, sequences, subarrays, subsequences, uint8array |

## Links

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

## Recent versions

- 0.0.2 (latest) — 2020-11-17
- 0.0.1 — 2020-11-15

## README

# has-subarrays
Quickly Determine if an Array contains Subarrays

# install
```bash
npm install has-subarrays
```

# usage
```javascript
const hasSubArrays = require("has-subarrays");

const numbers_one_to_ten = [1,2,3,4,5,6,7,8,9,10];

const { result } = hasSubArrays({
    data: numbers_one_to_ten,
    debug: true, // turn on for extra logging
    subarrays: {
        'one then two': [1, 2],
        'three then four': [3, 4]
    }
});
// result is true
```

# setting a threshold
You can specify a threshold, the number of unique matches after which it will return true.
If you don't specify a threshold, it will assume all subarrays must be found.
```javascript
const { result } = hasSubArrays({
    data: numbers_one_to_ten,
    debug: true, // turn on for extra logging
    subarrays: {
        'one then two': [1, 2],
        'three then four': [3, 4]
    },
    threshold: 1 // only one of the two subarrays must be found
});
// result is true
```

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