0.1.2 • Published 8 years ago

uniq-with v0.1.2

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

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

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago