# is-permutation

> Is list of numbers a permutation of 0 .. n?

Latest version **1.0.0** (published 2016-10-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-permutation
pnpm add is-permutation
yarn add is-permutation
bun add is-permutation
```

## 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.0 |
| Published | 2016-10-19 |
| First published | 2016-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jelle 'wires' Herold |
| Maintainers | wires |

## Links

- npm: https://www.npmjs.com/package/is-permutation
- npm.io page: https://npm.io/package/is-permutation

## Dependencies (1)

- [ramda](https://npm.io/package/ramda.md) ^0.22.1

## Recent versions

- 1.0.0 (latest) — 2016-10-19

## README

Is a list of numbers a permutations of 0 ... n ?

This library knows the answer.

```js
const isPermutation = require('is-permutation')
isPermutation([1,2,0]) //=> true! 0,1,2 has no gaps
isPermutation([1,0,3]) //=> false! 0,1,3 has a gap, 2 is missing
```

Oh oh, this doesn't work

```
isPermutation([0,1,2,2]) //=> dont pass duplicate numbers!
```

(it basically compares the sum of the list entries to the sum of the
numbers 0, 1, 2, .. until the length of the list)

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