mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 17:27:22 +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>
36 lines
1.3 KiB
JavaScript
36 lines
1.3 KiB
JavaScript
import _curry2 from './internal/_curry2.js';
|
|
import ap from './ap.js';
|
|
import map from './map.js';
|
|
import prepend from './prepend.js';
|
|
import reduceRight from './reduceRight.js';
|
|
|
|
/**
|
|
* Transforms a [Traversable](https://github.com/fantasyland/fantasy-land#traversable)
|
|
* of [Applicative](https://github.com/fantasyland/fantasy-land#applicative) into an
|
|
* Applicative of Traversable.
|
|
*
|
|
* Dispatches to the `sequence` method of the second argument, if present.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.19.0
|
|
* @category List
|
|
* @sig (Applicative f, Traversable t) => (a -> f a) -> t (f a) -> f (t a)
|
|
* @param {Function} of
|
|
* @param {*} traversable
|
|
* @return {*}
|
|
* @see R.traverse
|
|
* @example
|
|
*
|
|
* R.sequence(Maybe.of, [Just(1), Just(2), Just(3)]); //=> Just([1, 2, 3])
|
|
* R.sequence(Maybe.of, [Just(1), Just(2), Nothing()]); //=> Nothing()
|
|
*
|
|
* R.sequence(R.of, Just([1, 2, 3])); //=> [Just(1), Just(2), Just(3)]
|
|
* R.sequence(R.of, Nothing()); //=> [Nothing()]
|
|
*/
|
|
var sequence = /*#__PURE__*/_curry2(function sequence(of, traversable) {
|
|
return typeof traversable.sequence === 'function' ? traversable.sequence(of) : reduceRight(function (x, acc) {
|
|
return ap(map(prepend, x), acc);
|
|
}, of([]), traversable);
|
|
});
|
|
export default sequence; |