You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
868 B

4 years ago
  1. import _includes from "./internal/_includes.js";
  2. import _curry2 from "./internal/_curry2.js";
  3. import flip from "./flip.js";
  4. import reject from "./reject.js";
  5. /**
  6. * Returns a new list without values in the first argument.
  7. * [`R.equals`](#equals) is used to determine equality.
  8. *
  9. * Acts as a transducer if a transformer is given in list position.
  10. *
  11. * @func
  12. * @memberOf R
  13. * @since v0.19.0
  14. * @category List
  15. * @sig [a] -> [a] -> [a]
  16. * @param {Array} list1 The values to be removed from `list2`.
  17. * @param {Array} list2 The array to remove values from.
  18. * @return {Array} The new array without values in `list1`.
  19. * @see R.transduce, R.difference, R.remove
  20. * @example
  21. *
  22. * R.without([1, 2], [1, 2, 1, 3, 4]); //=> [3, 4]
  23. */
  24. var without =
  25. /*#__PURE__*/
  26. _curry2(function (xs, list) {
  27. return reject(flip(_includes)(xs), list);
  28. });
  29. export default without;