Function mapObject

Maps an object. The callback must return a key and value.

import {mapObject} from '@augment-vir/common';

mapObject({a: 1, b: 2}, (key, value) => {
return {
key: `key-${key}`,
value: `value-${value}`,
};
});
// output is `{'key-a': 'value-1', 'key-b': 'value-2'}`