source: node_modules/ramda/src/without.js@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1002 bytes
Line 
1var _curry2 =
2/*#__PURE__*/
3require("./internal/_curry2.js");
4
5var _Set =
6/*#__PURE__*/
7require("./internal/_Set.js");
8
9var reject =
10/*#__PURE__*/
11require("./reject.js");
12/**
13 * Returns a new list without values in the first argument.
14 * [`R.equals`](#equals) is used to determine equality.
15 *
16 * Acts as a transducer if a transformer is given in list position.
17 *
18 * @func
19 * @memberOf R
20 * @since v0.19.0
21 * @category List
22 * @sig [a] -> [a] -> [a]
23 * @param {Array} list1 The values to be removed from `list2`.
24 * @param {Array} list2 The array to remove values from.
25 * @return {Array} The new array without values in `list1`.
26 * @see R.transduce, R.difference, R.remove
27 * @example
28 *
29 * R.without([1, 2], [1, 2, 1, 3, 4]); //=> [3, 4]
30 */
31
32
33var without =
34/*#__PURE__*/
35_curry2(function without(xs, list) {
36 var toRemove = new _Set();
37
38 for (var i = 0; i < xs.length; i += 1) {
39 toRemove.add(xs[i]);
40 }
41
42 return reject(toRemove.has.bind(toRemove), list);
43});
44
45module.exports = without;
Note: See TracBrowser for help on using the repository browser.