UNPKG

kilto

Version:

A state management system with easy async and low boilerplate.

11 lines (9 loc) 265 B
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;