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