array/fill.js

  1. import _fill from 'lodash/fill.js'
  2. import { convert } from 'util/convert'
  3. /**
  4. * Replaces by an array filled with value from start up to, but not including, end.
  5. * @function
  6. * @memberof array
  7. * @param {Object} object The object to modify.
  8. * @param {Array|string} path The path of the property to set.
  9. * @param {*} value The value to fill array with.
  10. * @param {number} [start=0]
  11. * @param {number} [end=array.length]
  12. * @return {Object} Returns the updated object.
  13. * @example fill({ nested: { prop: [1, 2, 3, 4] } }, 'nested.prop', 6, 1, 3) // => { nested: { prop: [1, 6, 6, 4] } }
  14. * @see {@link https://lodash.com/docs#fill|lodash.fill} for more information.
  15. * @since 0.3.0
  16. */
  17. const fill = convert(_fill)
  18. export { fill, fill as default }