array/pullAll.js

  1. import { pullAll as _pullAll } from 'lodash/fp'
  2. import { convertLodashFp } from 'util/convertLodashFp'
  3. /**
  4. * This method is like {@link array.pull} except that it accepts an array of values to remove.
  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 {Array} values The values to remove.
  10. * @return {Object} Returns the updated object.
  11. * @example pullAll({ nested: { prop: [1, 2, 3, 1, 2, 3] } }, 'nested.prop', [1, 3]) // => { nested: { prop: [2, 2] } }
  12. * @see {@link https://lodash.com/docs#pullAll|lodash.pullAll} for more information.
  13. * @since 1.0.0
  14. */
  15. const pullAll = convertLodashFp(_pullAll)
  16. export { pullAll }