source: node_modules/ramda-adjunct/lib/nonePass.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.1 KB
RevLine 
[d24f17c]1"use strict";
2
3exports.__esModule = true;
4exports["default"] = void 0;
5var _ramda = require("ramda");
6/**
7 * Takes a list of predicates and returns a predicate that returns true for a given list of
8 * arguments if none of the provided predicates are satisfied by those arguments. It is the
9 * complement of Ramda's anyPass.
10 *
11 * The function returned is a curried function whose arity matches that of the
12 * highest-arity predicate.
13 *
14 * @func nonePass
15 * @memberOf RA
16 * @since {@link https://char0n.github.io/ramda-adjunct/2.5.0|v2.5.0}
17 * @category Logic
18 * @sig [(*... -> Boolean)] -> (*... -> Boolean)
19 * @param {Array} predicates An array of predicates to check
20 * @return {Function} The combined predicate
21 * @see {@link http://ramdajs.com/docs/#anyPass|R.anyPass}
22 * @example
23 *
24 * const gt10 = R.gt(R.__, 10)
25 * const even = (x) => x % 2 === 0;
26 * const f = RA.nonePass([gt10, even]);
27 *
28 * f(12); //=> false
29 * f(8); //=> false
30 * f(11); //=> false
31 * f(9); //=> true
32 */
33var nonePass = (0, _ramda.curryN)(1, (0, _ramda.compose)(_ramda.complement, _ramda.anyPass));
34var _default = nonePass;
35exports["default"] = _default;
Note: See TracBrowser for help on using the repository browser.