Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Applies a callback to each key-value pair of a Map, Object, or other collection. The original collection is not modified; a copy is returned.
Requires Node.js 7.0.0 or above.
npm i map-map
The module exports a single function.
map
(Array, iterator, Object, Map, Set, string, or Typed Array)mapper
(function): The callback which receives three arguments (key, value, and index) and which returns a two-element array containing the new key and value.options
: Object argument which is forwarded to entries-array
, a dependency of this module.A copy of map
which has had mapper
applied to each of its key-value pairs.
const mapMap = require('map-map')
let map = new Map([['key', 'value']])
map = mapMap(map, (key, value, index) => [key + '_mapped', value + '_mapped'])
map.get('key_mapped') // 'value_mapped'
Works on Objects too:
const mapMap = require('map-map')
let obj = {key: 'value'}
obj = mapMap(obj, (key, value, index) => [key + '_mapped', value + '_mapped'])
obj.key_mapped // 'value_mapped'
FAQs
Applies a callback to each key-value pair of a Map or Object.
The npm package map-map receives a total of 4 weekly downloads. As such, map-map popularity was classified as not popular.
We found that map-map demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.