source: node_modules/ramda-adjunct/src/notAllPass.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: 1.0 KB
Line 
1import { curry, complement, compose, allPass } from 'ramda';
2
3/**
4 * Takes a list of predicates and returns a predicate that returns true for a given list of
5 * arguments if one or more of the provided predicates is not satisfied by those arguments. It is
6 * the complement of Ramda's allPass.
7 *
8 * The function returned is a curried function whose arity matches that of the
9 * highest-arity predicate.
10 *
11 * @func notAllPass
12 * @memberOf RA
13 * @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
14 * @category Logic
15 * @sig [(*... -> Boolean)] -> (*... -> Boolean)
16 * @param {Array} predicates An array of predicates to check
17 * @return {Function} The combined predicate
18 * @see {@link http://ramdajs.com/docs/#allPass|R.allPass}
19 * @example
20 *
21 * const gt10 = R.gt(R.__, 10)
22 * const even = (x) => x % 2 === 0;
23 * const f = RA.notAllPass([gt10, even]);
24 *
25 * f(12); //=> false
26 * f(8); //=> true
27 * f(11); //=> true
28 * f(9); //=> true
29 */
30const notAllPass = curry(compose(complement, allPass));
31
32export default notAllPass;
Note: See TracBrowser for help on using the repository browser.