mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 17:27:22 +08:00
Major update breaking changes: - ESLint 7.0.0 (https://eslint.org/docs/user-guide/migrating-to-7.0.0) now includes .eslint.rc.js in its list, which is fine for us. Other changes are not applicable for us. - eslint-plugin-mocha (https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/CHANGELOG.md#700-may-13-2020) drops support for ESLint <7, but this CL updates to 7+. Other changes are not applicable for us. DISABLE_THIRD_PARTY_CHECK=Updating ESLint R=petermarshall@chromium.org Change-Id: I7760e084ef87f73a92f9ea4e075fb4c065047f5a Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2534873 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Peter Marshall <petermarshall@chromium.org>
56 lines
1.5 KiB
JavaScript
56 lines
1.5 KiB
JavaScript
var _curry2 =
|
|
/*#__PURE__*/
|
|
require("./internal/_curry2");
|
|
|
|
var _isFunction =
|
|
/*#__PURE__*/
|
|
require("./internal/_isFunction");
|
|
|
|
var lift =
|
|
/*#__PURE__*/
|
|
require("./lift");
|
|
|
|
var or =
|
|
/*#__PURE__*/
|
|
require("./or");
|
|
/**
|
|
* A function wrapping calls to the two functions in an `||` operation,
|
|
* returning the result of the first function if it is truth-y and the result
|
|
* of the second function otherwise. Note that this is short-circuited,
|
|
* meaning that the second function will not be invoked if the first returns a
|
|
* truth-y value.
|
|
*
|
|
* In addition to functions, `R.either` also accepts any fantasy-land compatible
|
|
* applicative functor.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.12.0
|
|
* @category Logic
|
|
* @sig (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)
|
|
* @param {Function} f a predicate
|
|
* @param {Function} g another predicate
|
|
* @return {Function} a function that applies its arguments to `f` and `g` and `||`s their outputs together.
|
|
* @see R.or
|
|
* @example
|
|
*
|
|
* const gt10 = x => x > 10;
|
|
* const even = x => x % 2 === 0;
|
|
* const f = R.either(gt10, even);
|
|
* f(101); //=> true
|
|
* f(8); //=> true
|
|
*
|
|
* R.either(Maybe.Just(false), Maybe.Just(55)); // => Maybe.Just(55)
|
|
* R.either([false, false, 'a'], [11]) // => [11, 11, "a"]
|
|
*/
|
|
|
|
|
|
var either =
|
|
/*#__PURE__*/
|
|
_curry2(function either(f, g) {
|
|
return _isFunction(f) ? function _either() {
|
|
return f.apply(this, arguments) || g.apply(this, arguments);
|
|
} : lift(or)(f, g);
|
|
});
|
|
|
|
module.exports = either; |