Skip to content

Instantly share code, notes, and snippets.

@vincentdchan
Created August 13, 2018 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentdchan/473b219b3cbbc64c903e9a1bf100e791 to your computer and use it in GitHub Desktop.
Save vincentdchan/473b219b3cbbc64c903e9a1bf100e791 to your computer and use it in GitHub Desktop.
// 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