array/pull.js

  1. import _pull from 'lodash/pull'
  2. import convert from '../util/convert'
  3. /**
  4. * Replaces an array removing all given values from 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 {...*} values The values to remove.
  10. * @return {Object} Returns the updated object.
  11. * @example pull({ nested: { prop: [1, 2, 3, 1, 2, 3] } }, 'nested.prop', 1, 3) // => { nested: { prop: [2, 2] } }
  12. * @see {@link https://lodash.com/docs#pull|lodash.pull} for more information.
  13. * @since 0.2.0
  14. */
  15. const pull = convert(_pull)
  16. export default pull