Skip to content

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

License

Notifications You must be signed in to change notification settings

lamansky/unique-object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unique-object

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

This module is an alias of unique-map, which supports both Maps and Objects.

Installation

npm install unique-object --save

Usage Example

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 module.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published