array/drop.js

  1. import _drop from 'lodash/drop'
  2. import convert from '../util/convert'
  3. /**
  4. * Replaces an array dropping one or several elements at the start of the former array.
  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 {number} [n=1] The number of elements to drop.
  10. * @return {Object} Returns the updated object.
  11. * @example drop({ nested: { prop: [1, 2, 3, 4] } }, 'nested.prop', 2) // => { nested: { prop: [3, 4] } }
  12. * @see {@link https://lodash.com/docs#drop|lodash.drop} for more information.
  13. * @since 0.2.0
  14. */
  15. const drop = convert(_drop)
  16. export default drop