UNPKG

1.06 kBJavaScriptView Raw
1var _complement =
2/*#__PURE__*/
3require("./internal/_complement");
4
5var _curry2 =
6/*#__PURE__*/
7require("./internal/_curry2");
8
9var all =
10/*#__PURE__*/
11require("./all");
12/**
13 * Returns `true` if no elements of the list match the predicate, `false`
14 * otherwise.
15 *
16 * Dispatches to the `all` method of the second argument, if present.
17 *
18 * Acts as a transducer if a transformer is given in list position.
19 *
20 * @func
21 * @memberOf R
22 * @since v0.12.0
23 * @category List
24 * @sig (a -> Boolean) -> [a] -> Boolean
25 * @param {Function} fn The predicate function.
26 * @param {Array} list The array to consider.
27 * @return {Boolean} `true` if the predicate is not satisfied by every element, `false` otherwise.
28 * @see R.all, R.any
29 * @example
30 *
31 * const isEven = n => n % 2 === 0;
32 * const isOdd = n => n % 2 === 1;
33 *
34 * R.none(isEven, [1, 3, 5, 7, 9, 11]); //=> true
35 * R.none(isOdd, [1, 3, 5, 7, 8, 11]); //=> false
36 */
37
38
39var none =
40/*#__PURE__*/
41_curry2(function none(fn, input) {
42 return all(_complement(fn), input);
43});
44
45module.exports = none;
\No newline at end of file