7 lines
182 B
JavaScript
7 lines
182 B
JavaScript
|
module.exports = {
|
||
|
mapObject(obj, mapper) {
|
||
|
const mappedObj = {};
|
||
|
Object.keys(obj).forEach(key => { mappedObj[key] = mapper(key, obj[key]); });
|
||
|
return mappedObj;
|
||
|
}
|
||
|
};
|