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 | |
---|
1 | var _complement =
|
---|
2 | /*#__PURE__*/
|
---|
3 | require("./internal/_complement.js");
|
---|
4 |
|
---|
5 | var _curry2 =
|
---|
6 | /*#__PURE__*/
|
---|
7 | require("./internal/_curry2.js");
|
---|
8 |
|
---|
9 | var filter =
|
---|
10 | /*#__PURE__*/
|
---|
11 | require("./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 |
|
---|
38 | var reject =
|
---|
39 | /*#__PURE__*/
|
---|
40 | _curry2(function reject(pred, filterable) {
|
---|
41 | return filter(_complement(pred), filterable);
|
---|
42 | });
|
---|
43 |
|
---|
44 | module.exports = reject; |
---|
Note:
See
TracBrowser
for help on using the repository browser.