$ cnpm install unique-by
Create a unique array of objects.
var uniqueBy = require('unique-by');
// With a function
uniqueBy(arr, function getValue(obj) {
return obj.someKey;
});
// With a key string
uniqueBy(arr, 'someKey');
npm install unique-by
npm test
npm run cover This runs the tests with code coveragenpm run lint This will run the linter on your codenpm test This will run the tests.npm run trace This will run your tests in tracing mode.npm run travis This is run by travis.CI to run your testsnpm run view-cover This will show code coverage in a browserCopyright 2013 - present © cnpmjs.org | Home |