# @writetome51/index-is-valid

> Function returns true or false based on whether or not a certain index can exist in a certain array length

Latest version **2.0.2** (published 2021-04-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @writetome51/index-is-valid
pnpm add @writetome51/index-is-valid
yarn add @writetome51/index-is-valid
bun add @writetome51/index-is-valid
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2021-04-19 |
| First published | 2019-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Steve Thompson |
| Maintainers | writetome51 |
| Keywords | array, index, exists, valid, validation, validator |

## Links

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

## Dependencies (1)

- [error-if-not-integer](https://npm.io/package/error-if-not-integer.md) ^2.0.1

## Alternatives

- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 2.0.2 (latest) — 2021-04-19
- 2.0.1 — 2020-08-27
- 2.0.0 — 2020-07-30
- 1.0.1 — 2019-04-09
- 1.0.0 — 2019-03-29

## README

# indexIsValid(index, arrayLength): boolean

Returns true or false based on whether or not `index` can exist in `arrayLength`.  
`index` can be negative or positive.

## Examples
```js
indexIsValid(0, 0); // --> false

indexIsValid(1, 1); // --> false

indexIsValid(-1, 1); // --> true

indexIsValid(1, 2); // --> true

indexIsValid(-2, 2); // --> true

indexIsValid(-3, 2); // --> false
```

## Installation
`npm i  @writetome51/index-is-valid`

## Loading
```js
import { indexIsValid } from '@writetome51/index-is-valid';
```

## License
[MIT](https://choosealicense.com/licenses/mit/)

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