# unrepeatable

> ``` const {mergeAndUnique, uniqueBy, unique} = require("./unique"); unique([1,3,1,2]) ```

Latest version **0.1.1** (published 2018-09-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install unrepeatable
pnpm add unrepeatable
yarn add unrepeatable
bun add unrepeatable
```

## 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.1.1 |
| Published | 2018-09-26 |
| First published | 2018-09-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Pawel Rusek |
| Maintainers | sekru |

## Links

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

## Recent versions

- 0.1.1 (latest) — 2018-09-26
- 0.1.0 — 2018-09-25

## README

# Make array unique!
# High performance

```
const {mergeAndUnique, uniqueBy, unique} = require("./unique");
unique([1,3,1,2])
```

```
const duplicatedArray = [
    {
        "id": 1,
        "name": "test"
    },
    {
        "id": 2,
        "name": "test"
    },
    {
        "id": 2,
        "name": "test"
    }
];

uniqueBy(duplicatedArray, 'id');
```

```
const commonArray = [
    {
        "id": 1,
        "name": "test"
    },
    {
        "id": 2,
        "name": "test"
    }
];
const duplicatedArray = [
    {
        "id": 1,
        "name": "test"
    }
];

mergeAndUnique(duplicatedArray, commonArray, 'id', wasUnique = true/false); // 'wasUnique' it's about commonArray
commonArray.length.should.be.eql(2);
```

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