{"library":"lodash._pickbycallback","title":"Lodash Internal pickByCallback Module","description":"The `lodash._pickbycallback` package provides a modularized export of Lodash's internal `pickByCallback` utility function. This package, currently at version 3.0.0, represents an older strategy for consuming individual Lodash functions as standalone CommonJS modules. It was designed to address bundle size concerns in environments where importing the entire Lodash library was undesirable. However, this approach is now considered legacy. The main `lodash` package is currently at v4.18.1 and offers more efficient modularization methods like `lodash-es` for ESM environments or direct per-method imports (e.g., `require('lodash/pickBy')`) that support modern tree-shaking bundlers. This specific sub-package has not received updates since its initial v3.0.0 release, meaning it lacks bug fixes and security patches applied to the main Lodash library in its v4.x releases.","language":"javascript","status":"deprecated","last_verified":"Sun Apr 19","install":{"commands":["npm install lodash._pickbycallback"],"cli":null},"imports":["var pickByCallback = require('lodash._pickbycallback');","import pickByCallback from 'lodash._pickbycallback';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const pickByCallback = require('lodash._pickbycallback');\n\nconst users = {\n  'fred':    { 'user': 'fred',    'active': false },\n  'barney':  { 'user': 'barney',  'active': true  },\n  'pebbles': { 'user': 'pebbles', 'active': false }\n};\n\nconst activeUsers = pickByCallback(users, (value) => value.active);\n\nconsole.log(activeUsers);\n// Expected output: { barney: { user: 'barney', active: true } }\n\nconst numbers = {\n  'a': 1,\n  'b': 0,\n  'c': undefined\n};\n\n// Note: `pickByCallback` (equivalent to `_.pickBy`) by default treats 0, false, null, undefined as falsey and filters them.\nconst truthyNumbers = pickByCallback(numbers, (value) => !!value);\nconsole.log(truthyNumbers);\n// Expected output: { a: 1 }","lang":"javascript","description":"This code demonstrates how to import and use the `pickByCallback` function from the `lodash._pickbycallback` package in a CommonJS Node.js environment, filtering active users from an object.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}