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:
1017 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import _complement from "./internal/_complement.js";
|
---|
| 2 | import _curry2 from "./internal/_curry2.js";
|
---|
| 3 | import all from "./all.js";
|
---|
| 4 | /**
|
---|
| 5 | * Returns `true` if no elements of the list match the predicate, `false`
|
---|
| 6 | * otherwise.
|
---|
| 7 | *
|
---|
| 8 | * Dispatches to the `all` method of the second argument, if present.
|
---|
| 9 | *
|
---|
| 10 | * Acts as a transducer if a transformer is given in list position.
|
---|
| 11 | *
|
---|
| 12 | * @func
|
---|
| 13 | * @memberOf R
|
---|
| 14 | * @since v0.12.0
|
---|
| 15 | * @category List
|
---|
| 16 | * @sig (a -> Boolean) -> [a] -> Boolean
|
---|
| 17 | * @param {Function} fn The predicate function.
|
---|
| 18 | * @param {Array} list The array to consider.
|
---|
| 19 | * @return {Boolean} `true` if the predicate is not satisfied by every element, `false` otherwise.
|
---|
| 20 | * @see R.all, R.any
|
---|
| 21 | * @example
|
---|
| 22 | *
|
---|
| 23 | * const isEven = n => n % 2 === 0;
|
---|
| 24 | * const isOdd = n => n % 2 !== 0;
|
---|
| 25 | *
|
---|
| 26 | * R.none(isEven, [1, 3, 5, 7, 9, 11]); //=> true
|
---|
| 27 | * R.none(isOdd, [1, 3, 5, 7, 8, 11]); //=> false
|
---|
| 28 | */
|
---|
| 29 |
|
---|
| 30 | var none =
|
---|
| 31 | /*#__PURE__*/
|
---|
| 32 | _curry2(function none(fn, input) {
|
---|
| 33 | return all(_complement(fn), input);
|
---|
| 34 | });
|
---|
| 35 |
|
---|
| 36 | export default none; |
---|
Note:
See
TracBrowser
for help on using the repository browser.