An open API service indexing awesome lists of open source software.

https://github.com/lamansky/unique-object

[Node.js] Returns a copy of an Object or Map with duplicate values removed.
https://github.com/lamansky/unique-object

Last synced: 3 months ago
JSON representation

[Node.js] Returns a copy of an Object or Map with duplicate values removed.

Awesome Lists containing this project

README

          

# unique-object

Returns a copy of an Object or Map with duplicate values removed.

This module is an alias of [`unique-map`](https://github.com/lamansky/unique-map), which supports both Maps and Objects.

## Installation

```bash
npm install unique-object --save
```

## Usage Example

```javascript
const uniqueObject = require('unique-object')

const obj = {
1: 'A',
2: 'A',
3: 'B',
}

const u = uniqueObject(obj)
u[1] // 'A'
u[2] // undefined
u[3] // 'B'
```

For more details, see the documentation for the [`unique-map`](https://github.com/lamansky/unique-map) module.