UNPKG

rambdax

Version:

Extended version of Rambda - a lightweight, faster alternative to Ramda

9 lines (7 loc) 257 B
export function either(firstPredicate, secondPredicate){ if (arguments.length === 1){ return _secondPredicate => either(firstPredicate, _secondPredicate) } return (...input) => Boolean(firstPredicate(...input) || secondPredicate(...input)) }