Created
August 13, 2018 08:23
-
-
Save vincentdchan/473b219b3cbbc64c903e9a1bf100e791 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// copy from rambda/es/allPass.js | |
import _curry1 from './internal/_curry1'; | |
import curryN from './curryN'; | |
import max from './max'; | |
import pluck from './pluck'; | |
var allPass = /*#__PURE__*/_curry1(function allPass(preds) { | |
return curryN(reduce(max, 0, pluck('length', preds)), function () { | |
var idx = 0; | |
var len = preds.length; | |
while (idx < len) { | |
if (!preds[idx].apply(this, arguments)) { | |
return false; | |
} | |
idx += 1; | |
} | |
return true; | |
}); | |
}); | |
export default allPass; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment