{"id":15458,"library":"lodash._arraymap","title":"Lodash Internal Array Map Module (v3)","description":"This package exports `lodash`'s internal `arrayMap` function, specifically from the `lodash` v3 ecosystem, as a standalone CommonJS module. Released around 2015, it was designed for specific modular builds of Lodash rather than general direct consumption. The core `lodash` library, now in its v4 series, has evolved significantly, and developers are strongly advised to use the stable `_.map` function directly from the main `lodash` or `lodash-es` packages. This specific internal module is no longer actively maintained or updated independently, and its usage is generally discouraged in favor of stable, public APIs. The main `lodash` library follows semantic versioning with a generally active release cadence, but this specific module is tied to an older, unmaintained major version.","status":"abandoned","version":"3.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/lodash/lodash","tags":["javascript"],"install":[{"cmd":"npm install lodash._arraymap","lang":"bash","label":"npm"},{"cmd":"yarn add lodash._arraymap","lang":"bash","label":"yarn"},{"cmd":"pnpm add lodash._arraymap","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CommonJS-only and from Lodash v3. No ESM equivalent.","symbol":"arrayMap","correct":"const arrayMap = require('lodash._arraymap');"}],"quickstart":{"code":"const arrayMap = require('lodash._arraymap');\n\nconst numbers = [1, 2, 3];\nconst doubledNumbers = arrayMap(numbers, (n) => n * 2);\n\nconsole.log('Original numbers:', numbers);\nconsole.log('Doubled numbers (via _arraymap):', doubledNumbers);\n\n// For comparison, using modern lodash's _.map (recommended):\n// const _ = require('lodash'); // Or import { map } from 'lodash';\n// const modernDoubled = _.map(numbers, (n) => n * 2);\n// console.log('Doubled numbers (via _.map):', modernDoubled);","lang":"javascript","description":"Demonstrates basic usage of the internal `arrayMap` function on an array, noting its CJS nature."},"warnings":[{"fix":"Migrate to `_.map` from the main `lodash` or `lodash-es` package. If specific array iteration is needed, consider native `Array.prototype.map`.","message":"The `lodash._arraymap` package is an internal module from Lodash v3.0.0. Its API and existence are not guaranteed across Lodash major versions. Direct usage may break without warning when migrating to newer Lodash versions (v4+) or when other parts of the ecosystem expect `lodash` v4+ behavior.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Replace `require('lodash._arraymap')` with `const _ = require('lodash');` and use `_.map(collection, iterator);` or for ESM `import { map } from 'lodash-es';` and `map(collection, iterator);`.","message":"Users should utilize the stable and public `_.map` function from the main `lodash` or `lodash-es` packages instead of this internal utility. `_.map` provides a documented API that handles various collection types, is actively maintained, and receives security updates.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"For ESM projects, avoid using this module. Prefer `_.map` from `lodash-es` which provides full ESM support. If forced to use CJS in an ESM context, consider dynamic `import()` or specific build tool configurations.","message":"This module is a CommonJS-only package. It does not provide ES module (ESM) exports, which can lead to compatibility issues or require specific configuration when used in modern JavaScript projects that primarily target ESM.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Always use the latest stable version of the main `lodash` or `lodash-es` package and rely on its public, documented APIs (`_.map`) to ensure you receive critical security updates and benefit from improved internal hardening.","message":"While this specific package `lodash._arraymap` v3.0.0 is very old and unmaintained, the main `lodash` library has had critical security advisories (e.g., prototype pollution fixes in v4.18.0). Using old, unmaintained internal modules like this could potentially expose applications to vulnerabilities if they bypass the hardened, public APIs of newer Lodash versions.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"This package is CommonJS only. Either convert your file to a CommonJS module, use dynamic `import()` (if supported by your environment), or preferably, switch to `lodash-es` and use its `map` function.","cause":"Attempting to use `require('lodash._arraymap')` in an ES module context (e.g., a file with `type: module` or `.mjs` extension).","error":"ReferenceError: require is not defined"},{"fix":"Ensure the import is `const arrayMap = require('lodash._arraymap');` and that `arrayMap` is called with an array as the first argument and a function as the second, matching its internal signature.","cause":"Incorrectly importing the module (e.g., `import arrayMap from 'lodash._arraymap';` in CJS, or a typo in the variable name) or attempting to call it with non-array arguments that it's not designed to handle.","error":"TypeError: arrayMap is not a function"}],"ecosystem":"npm"}