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. * @see {@link https://lodash.com/docs#identity|lodash.identity} for more information.
  14. * @see {@link object.update|update} for more information.
  15. * @since 0.1.8
  16. */
  17. const map = convert(_map)
  18. export default map