source:
node_modules/es-toolkit/dist/map/mapKeys.mjs@
a762898
| Last change on this file since a762898 was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 237 bytes | |
| Rev | Line | |
|---|---|---|
| [a762898] | 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.
