UNPKG
kilto
Version:
latest (0.4.1)
0.4.1
0.4.0
0.3.0
0.2.1
0.2.0
0.1.1
0.0.9
0.0.8
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
A state management system with easy async and low boilerplate.
kilto
/
src
/
util
/
mapObjectToObject.js
11 lines
(9 loc)
•
265 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
const
mapObjectToObject
= (
obj, cb
) => {
const
result = {};
Object
.
keys
(obj).
forEach
(
(
oldKey, index
) =>
{
const
[newKey, newValue] =
cb
(oldKey, obj[oldKey], index); result[newKey] = newValue; });
return
result; };
export
default
mapObjectToObject;