mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 01:38:07 +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>
55 lines
1.8 KiB
JavaScript
55 lines
1.8 KiB
JavaScript
var _curry2 =
|
|
/*#__PURE__*/
|
|
require("./internal/_curry2");
|
|
|
|
var curryN =
|
|
/*#__PURE__*/
|
|
require("./curryN");
|
|
/**
|
|
* Accepts a function `fn` and a list of transformer functions and returns a
|
|
* new curried function. When the new function is invoked, it calls the
|
|
* function `fn` with parameters consisting of the result of calling each
|
|
* supplied handler on successive arguments to the new function.
|
|
*
|
|
* If more arguments are passed to the returned function than transformer
|
|
* functions, those arguments are passed directly to `fn` as additional
|
|
* parameters. If you expect additional arguments that don't need to be
|
|
* transformed, although you can ignore them, it's best to pass an identity
|
|
* function so that the new function reports the correct arity.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.1.0
|
|
* @category Function
|
|
* @sig ((x1, x2, ...) -> z) -> [(a -> x1), (b -> x2), ...] -> (a -> b -> ... -> z)
|
|
* @param {Function} fn The function to wrap.
|
|
* @param {Array} transformers A list of transformer functions
|
|
* @return {Function} The wrapped function.
|
|
* @see R.converge
|
|
* @example
|
|
*
|
|
* R.useWith(Math.pow, [R.identity, R.identity])(3, 4); //=> 81
|
|
* R.useWith(Math.pow, [R.identity, R.identity])(3)(4); //=> 81
|
|
* R.useWith(Math.pow, [R.dec, R.inc])(3, 4); //=> 32
|
|
* R.useWith(Math.pow, [R.dec, R.inc])(3)(4); //=> 32
|
|
* @symb R.useWith(f, [g, h])(a, b) = f(g(a), h(b))
|
|
*/
|
|
|
|
|
|
var useWith =
|
|
/*#__PURE__*/
|
|
_curry2(function useWith(fn, transformers) {
|
|
return curryN(transformers.length, function () {
|
|
var args = [];
|
|
var idx = 0;
|
|
|
|
while (idx < transformers.length) {
|
|
args.push(transformers[idx].call(this, arguments[idx]));
|
|
idx += 1;
|
|
}
|
|
|
|
return fn.apply(this, args.concat(Array.prototype.slice.call(arguments, transformers.length)));
|
|
});
|
|
});
|
|
|
|
module.exports = useWith; |