mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-11 14:14:36 +08:00
DISABLE_THIRD_PARTY_CHECK=new npm module causes package-lock change We can get rid of a custom script and use ESLint for these rules. Additionally this means editors will highlight the issue in the editor. Change-Id: I552b52e7f07b4e7430b3f685dbc3b5fad36ffff2 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2052167 Reviewed-by: Paul Lewis <aerotwist@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
import _curry1 from './internal/_curry1.js';
|
|
import curryN from './curryN.js';
|
|
import max from './max.js';
|
|
import pluck from './pluck.js';
|
|
import reduce from './reduce.js';
|
|
|
|
/**
|
|
* Takes a list of predicates and returns a predicate that returns true for a
|
|
* given list of arguments if every 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.anyPass
|
|
* @example
|
|
*
|
|
* const isQueen = R.propEq('rank', 'Q');
|
|
* const isSpade = R.propEq('suit', '♠︎');
|
|
* const isQueenOfSpades = R.allPass([isQueen, isSpade]);
|
|
*
|
|
* isQueenOfSpades({rank: 'Q', suit: '♣︎'}); //=> false
|
|
* isQueenOfSpades({rank: 'Q', suit: '♠︎'}); //=> true
|
|
*/
|
|
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; |