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

37 lines
972 B
TypeScript

// Loaded from https://deno.land/x/ramda@v0.27.2/source/reject.js
import _complement from './internal/_complement.js';
import _curry2 from './internal/_curry2.js';
import filter from './filter.js';
/**
* The complement of [`filter`](#filter).
*
* Acts as a transducer if a transformer is given in list position. Filterable
* objects include plain objects or any object that has a filter method such
* as `Array`.
*
* @func
* @memberOf R
* @since v0.1.0
* @category List
* @sig Filterable f => (a -> Boolean) -> f a -> f a
* @param {Function} pred
* @param {Array} filterable
* @return {Array}
* @see R.filter, R.transduce, R.addIndex
* @example
*
* const isOdd = (n) => n % 2 === 1;
*
* R.reject(isOdd, [1, 2, 3, 4]); //=> [2, 4]
*
* R.reject(isOdd, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}
*/
var reject = _curry2(function reject(pred, filterable) {
return filter(_complement(pred), filterable);
});
export default reject;