UNPKG

moy-fp

Version:
19 lines (16 loc) 384 B
import curry from '../Function/curry' import nAry from '../Function/nAry' /** * [(a, b, ..., m) -> Boolean] -> ((a, b, ..., m) -> Boolean) */ const anyPass = curry( preds => nAry(preds.reduce((n, p) => Math.max(n, p.length), 0), (...args) => { for(let pred of preds){ if(pred(...args)){ return true } } return false }) ) export default anyPass