swc/crates/swc_bundler/tests/.cache/deno/c5efacd3b01ae2bec96353858bc543e6a6055224.ts
2021-11-09 20:42:49 +09:00

38 lines
1.0 KiB
TypeScript

// Loaded from https://deno.land/x/ramda@v0.27.2/source/none.js
import _complement from './internal/_complement.js';
import _curry2 from './internal/_curry2.js';
import all from './all.js';
/**
* Returns `true` if no elements of the list match the predicate, `false`
* otherwise.
*
* Dispatches to the `all` method of the second argument, if present.
*
* Acts as a transducer if a transformer is given in list position.
*
* @func
* @memberOf R
* @since v0.12.0
* @category List
* @sig (a -> Boolean) -> [a] -> Boolean
* @param {Function} fn The predicate function.
* @param {Array} list The array to consider.
* @return {Boolean} `true` if the predicate is not satisfied by every element, `false` otherwise.
* @see R.all, R.any
* @example
*
* const isEven = n => n % 2 === 0;
* const isOdd = n => n % 2 === 1;
*
* R.none(isEven, [1, 3, 5, 7, 9, 11]); //=> true
* R.none(isOdd, [1, 3, 5, 7, 8, 11]); //=> false
*/
var none = _curry2(function none(fn, input) {
return all(_complement(fn), input);
});
export default none;