lodash internal baseCallback (v3)

raw JSON →
3.3.1 verified Sat Apr 25 auth: no javascript deprecated

An internal lodash module exporting the baseCallback function used in lodash v3.x (modern build). This package is part of lodash's modular build system from the v3 era and is not intended for direct public use. The latest version is 3.3.1, which corresponds to lodash v3.3.1. It was superseded by lodash v4's internal restructuring. Unlike the main lodash package, which continues with v4.x, this module is frozen at v3 and receives no further updates. Developers should not depend on it; use lodash's public API instead.

error Cannot find module 'lodash._basecallback'
cause Package not installed, or typo in package name.
fix
Run 'npm install lodash._basecallback' and ensure package name is correct.
error ReferenceError: baseCallback is not defined
cause Using ES import syntax (import) instead of require().
fix
Use 'var baseCallback = require('lodash._basecallback');'
deprecated This package is internal and frozen at lodash v3.3.1. Do not use in new projects.
fix Use the lodash v4.x public API (e.g., lodash.iteratee or _.iteratee) instead.
breaking The package exports a single function, not an object with methods.
fix Use require() directly without destructuring: var baseCallback = require('lodash._basecallback');
gotcha No TypeScript typings available; using in TypeScript requires manual type declaration.
fix Create a .d.ts file or use lodash v4's @types/lodash.
npm install lodash._basecallback
yarn add lodash._basecallback
pnpm add lodash._basecallback

Shows how to import and use baseCallback to create a callback for lodash v3-style iteration.

var baseCallback = require('lodash._basecallback');
// Example usage: iteratee for collection methods
var users = [
  { 'user': 'barney', 'active': true },
  { 'user': 'fred',   'active': false }
];
function predicate(user) { return user.active; }
var callback = baseCallback(predicate, null, 0);
var result = users.filter(callback);
console.log(result); // => [{ 'user': 'barney', 'active': true }]