source:
node_modules/es-toolkit/dist/map/mapValues.mjs
| Last change on this file was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 247 bytes | |
| Rev | Line | |
|---|---|---|
| [a762898] | 1 | function mapValues(map, getNewValue) { |
| 2 | const result = new Map(); | |
| 3 | for (const [key, value] of map) { | |
| 4 | const newValue = getNewValue(value, key, map); | |
| 5 | result.set(key, newValue); | |
| 6 | } | |
| 7 | return result; | |
| 8 | } | |
| 9 | ||
| 10 | export { mapValues }; |
Note:
See TracBrowser
for help on using the repository browser.
