|
Last change
on this file since ba17441 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
414 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 4 |
|
|---|
| 5 | function mapValues(object, getNewValue) {
|
|---|
| 6 | const result = {};
|
|---|
| 7 | const keys = Object.keys(object);
|
|---|
| 8 | for (let i = 0; i < keys.length; i++) {
|
|---|
| 9 | const key = keys[i];
|
|---|
| 10 | const value = object[key];
|
|---|
| 11 | result[key] = getNewValue(value, key, object);
|
|---|
| 12 | }
|
|---|
| 13 | return result;
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | exports.mapValues = mapValues;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.