collection/map.js

  1. import _map from 'lodash/map'
  2. import { convert } from 'util/convert'
  3. /**
  4. * Replaces by an array of values by running each element in the former collection thru iteratee.
  5. * The iteratee is invoked with three arguments: (value, index|key, collection).
  6. * @function
  7. * @memberof collection
  8. * @param {Object} object The object to modify.
  9. * @param {Array|string} path The path of the property to set.
  10. * @param {function} [iteratee={@link https://lodash.com/docs#identity|lodash.identity}] The function invoked per iteration.
  11. * @return {Object} Returns the updated object.
  12. * @see {@link https://lodash.com/docs#map|lodash.map} for more information.
  13. * @example map({ nested: { prop: [1, 2, 3] } }, 'nested.prop', v => v * 2) // => { nested: { prop: [2, 4, 6] } }
  14. * @since 0.1.8
  15. */
  16. const map = convert(_map)
  17. export { map, map as default }