Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

Latest commit

 

History

History
24 lines (20 loc) · 802 Bytes

anyPass.md

File metadata and controls

24 lines (20 loc) · 802 Bytes

Takes a list of predicates and returns a predicate that returns true for a given list of arguments if at least one of the provided predicates is satisfied by those arguments.

The function returned is a curried function whose arity matches that of the highest-arity predicate.

@func @memberOf R @since v0.9.0 @category Logic @sig [(... -> Boolean)] -> (... -> Boolean) @param {Array} predicates An array of predicates to check @return {Function} The combined predicate @see R.allPass @example

 var isClub = R.propEq('suit', '♣');
 var isSpade = R.propEq('suit', '♠');
 var isBlackCard = R.anyPass([isClub, isSpade]);

 isBlackCard({rank: '10', suit: '♣'}); //=> true
 isBlackCard({rank: 'Q', suit: '♠'}); //=> true
 isBlackCard({rank: 'Q', suit: '♦'}); //=> false