source: node_modules/ramda/src/reject.js

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

Initial commit

  • Property mode set to 100644
File size: 973 bytes
Line 
1var _complement =
2/*#__PURE__*/
3require("./internal/_complement.js");
4
5var _curry2 =
6/*#__PURE__*/
7require("./internal/_curry2.js");
8
9var filter =
10/*#__PURE__*/
11require("./filter.js");
12/**
13 * The complement of [`filter`](#filter).
14 *
15 * Acts as a transducer if a transformer is given in list position. Filterable
16 * objects include plain objects or any object that has a filter method such
17 * as `Array`.
18 *
19 * @func
20 * @memberOf R
21 * @since v0.1.0
22 * @category List
23 * @sig Filterable f => (a -> Boolean) -> f a -> f a
24 * @param {Function} pred
25 * @param {Array} filterable
26 * @return {Array}
27 * @see R.filter, R.transduce, R.addIndex
28 * @example
29 *
30 * const isOdd = (n) => n % 2 !== 0;
31 *
32 * R.reject(isOdd, [1, 2, 3, 4]); //=> [2, 4]
33 *
34 * R.reject(isOdd, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}
35 */
36
37
38var reject =
39/*#__PURE__*/
40_curry2(function reject(pred, filterable) {
41 return filter(_complement(pred), filterable);
42});
43
44module.exports = reject;
Note: See TracBrowser for help on using the repository browser.