You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

lodash.uniqby

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.uniqby

The lodash method `_.uniqBy` exported as a module.


Version published
Weekly downloads
2.2M
decreased by-19.19%
Maintainers
3
Created
Weekly downloads
 

Package description

What is lodash.uniqby?

The lodash.uniqby package is a part of the Lodash library, specifically designed for creating arrays with unique elements based on a specified criterion. It allows for filtering out duplicate values in an array by comparing the result of running each element through an iteratee function. This is particularly useful for dealing with arrays of objects where uniqueness should be determined based on specific properties.

What are lodash.uniqby's main functionalities?

Removing duplicate objects based on a specific property

This feature allows for the removal of duplicate objects from an array based on a specific property. In this example, the array of objects is filtered to ensure uniqueness based on the 'id' property.

[{ 'id': 1, 'name': 'John' }, { 'id': 2, 'name': 'Doe' }, { 'id': 1, 'name': 'John' }].filter((v, i, a) => a.findIndex(t => (t.id === v.id)) === i)

Other packages similar to lodash.uniqby

Readme

Source

lodash.uniqby v4.0.2

The lodash method _.uniqBy exported as a Node.js module.

Installation

Using npm:

$ {sudo -H} npm i -g npm
$ npm i --save lodash.uniqby

In Node.js:

var uniqBy = require('lodash.uniqby');

See the documentation or package source for more details.

Keywords

FAQs

Package last updated on 26 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc