Skip to content

queckezz/uniq-with

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uniq-with

Remove duplicates based on a predicate function.

build status npm version dependency status license code style: standard

Installation

$ npm install uniq-with

Example

const uniqWith = require('uniq-with')

const data = [
  { id: 1 },
  { id: 5 },
  { id: 2 },
  { id: 2 },
  { id: 2 },
  { id: 5 }
]

console.log(uniqWith((a, b) => a.id === b.id, data))

// ->
// [
//   { id: 1 },
//   { id: 5 },
//   { id: 2 }
// ]

Tests

$ npm test 

License

MIT

About

Remove duplicates based on a predicate function

Resources

License

Stars

Watchers

Forks

Packages

No packages published