mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-05 19:41:12 +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>
32 lines
1005 B
JavaScript
32 lines
1005 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; |