Socket
Socket
Sign inDemoInstall

lodash.pickby

Package Overview
Dependencies
0
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lodash.pickby

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


Version published
Maintainers
3
Install size
67.0 kB
Created

Package description

What is lodash.pickby?

The lodash.pickby npm package is a method from the Lodash library that creates an object composed of the object properties predicate returns truthy for. The predicate is invoked with two arguments: (value, key).

What are lodash.pickby's main functionalities?

Filtering object properties based on values

This code uses lodash.pickby to create a new object from the given object by keeping only the properties where the values are numbers.

{"result": _.pickBy({ 'a': 1, 'b': '2', 'c': 3 }, _.isNumber)}

Filtering object properties based on custom predicate

This code demonstrates how to use a custom predicate function to filter object properties, keeping only those where the value is greater than 1.

{"result": _.pickBy({ 'a': 1, 'b': '2', 'c': 3 }, function(value) { return value > 1; })}

Other packages similar to lodash.pickby

Readme

Source

lodash.pickby v4.6.0

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

Installation

Using npm:

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

In Node.js:

var pickBy = require('lodash.pickby');

See the documentation or package source for more details.

Keywords

FAQs

Last updated on 13 Aug 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc