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>
37 lines
1009 B
JavaScript
37 lines
1009 B
JavaScript
import _curry2 from "./internal/_curry2.js";
|
|
/**
|
|
* Creates a new list out of the two supplied by pairing up equally-positioned
|
|
* items from both lists. The returned list is truncated to the length of the
|
|
* shorter of the two input lists.
|
|
* Note: `zip` is equivalent to `zipWith(function(a, b) { return [a, b] })`.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.1.0
|
|
* @category List
|
|
* @sig [a] -> [b] -> [[a,b]]
|
|
* @param {Array} list1 The first array to consider.
|
|
* @param {Array} list2 The second array to consider.
|
|
* @return {Array} The list made by pairing up same-indexed elements of `list1` and `list2`.
|
|
* @example
|
|
*
|
|
* R.zip([1, 2, 3], ['a', 'b', 'c']); //=> [[1, 'a'], [2, 'b'], [3, 'c']]
|
|
* @symb R.zip([a, b, c], [d, e, f]) = [[a, d], [b, e], [c, f]]
|
|
*/
|
|
|
|
var zip =
|
|
/*#__PURE__*/
|
|
_curry2(function zip(a, b) {
|
|
var rv = [];
|
|
var idx = 0;
|
|
var len = Math.min(a.length, b.length);
|
|
|
|
while (idx < len) {
|
|
rv[idx] = [a[idx], b[idx]];
|
|
idx += 1;
|
|
}
|
|
|
|
return rv;
|
|
});
|
|
|
|
export default zip; |