Basic usage

Given an object and a toValue callback function, returns a new object with all the values mapped through the toValue function. The callback is given both the value and key for each entry.

import { mapValues } from 'radash'

const ra = {
  mode: 'god',
  power: 'sun'
}

mapValues(ra, value => value.toUpperCase()) // => { mode: 'GOD', power: 'SUN' }
mapValues(ra, (value, key) => key) // => { mode: 'mode', power: 'power' }

Testing

This _.mapValues function is 100% covered by tests. See them and contribute at GitHub.

Source

See the source for _.mapValues on GitHub.