UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

13 lines (11 loc) 316 B
function mapValues(object, getNewValue) { const result = {}; const keys = Object.keys(object); for (let i = 0; i < keys.length; i++) { const key = keys[i]; const value = object[key]; result[key] = getNewValue(value, key, object); } return result; } export { mapValues };