Skip to content

Commit 8b71bd9

Browse files
committed
Auto-generated commit
1 parent 11f8aa7 commit 8b71bd9

File tree

7 files changed

+54
-13
lines changed

7 files changed

+54
-13
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-07-27)
7+
## Unreleased (2025-07-28)
88

99
<section class="features">
1010

@@ -16,12 +16,24 @@
1616

1717
<!-- /.features -->
1818

19+
<section class="bug-fixes">
20+
21+
### Bug Fixes
22+
23+
- [`f53879d`](https://github.com/stdlib-js/stdlib/commit/f53879de98a2f80792d3d97c7748fd7425800aac) - ensure support for outer accessor arrays
24+
25+
</section>
26+
27+
<!-- /.bug-fixes -->
28+
1929
<section class="commits">
2030

2131
### Commits
2232

2333
<details>
2434

35+
- [`f53879d`](https://github.com/stdlib-js/stdlib/commit/f53879de98a2f80792d3d97c7748fd7425800aac) - **fix:** ensure support for outer accessor arrays _(by Athan Reines)_
36+
- [`7f0568c`](https://github.com/stdlib-js/stdlib/commit/7f0568c02fad49db0292ed2c15eed93e281b3d3f) - **bench:** fix descriptions _(by Athan Reines)_
2537
- [`e669353`](https://github.com/stdlib-js/stdlib/commit/e669353fc68d57800199dcb773accd5ce9943cef) - **feat:** add `array/base/zip` _(by Athan Reines)_
2638

2739
</details>

benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var zip = require( './../lib' );
2929

3030
// MAIN //
3131

32-
bench( pkg+':len=100', function benchmark( b ) {
32+
bench( pkg+':len=10', function benchmark( b ) {
3333
var x;
3434
var i;
3535
var v;

dist/index.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/main.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// MODULES //
2222

2323
var resolveGetter = require( '@stdlib/array-base-resolve-getter' );
24+
var copy = require( '@stdlib/array-base-copy' );
2425

2526

2627
// MAIN //
@@ -44,6 +45,7 @@ var resolveGetter = require( '@stdlib/array-base-resolve-getter' );
4445
*/
4546
function zip( arrays ) {
4647
var getters;
48+
var list;
4749
var out;
4850
var arr;
4951
var M;
@@ -55,19 +57,20 @@ function zip( arrays ) {
5557
if ( M < 1 ) {
5658
return [];
5759
}
58-
N = arrays[ 0 ].length;
60+
list = copy( arrays );
61+
N = list[ 0 ].length;
5962
if ( N < 1 ) {
6063
return [];
6164
}
6265
getters = [];
6366
for ( j = 0; j < M; j++ ) {
64-
getters.push( resolveGetter( arrays[ j ] ) );
67+
getters.push( resolveGetter( list[ j ] ) );
6568
}
6669
out = [];
6770
for ( i = 0; i < N; i++ ) {
6871
arr = [];
6972
for ( j = 0; j < M; j++ ) {
70-
arr.push( getters[ j ]( arrays[ j ], i ) );
73+
arr.push( getters[ j ]( list[ j ], i ) );
7174
}
7275
out.push( arr );
7376
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"url": "https://github.com/stdlib-js/stdlib/issues"
3838
},
3939
"dependencies": {
40+
"@stdlib/array-base-copy": "^0.2.2",
4041
"@stdlib/array-base-resolve-getter": "^0.2.2",
4142
"@stdlib/types": "^0.4.3"
4243
},

test/test.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ tape( 'main export is a function', function test( t ) {
3333
t.end();
3434
});
3535

36-
tape( 'the function returns an empty array if provided no input arrays', function test( t ) {
36+
tape( 'the function returns an empty array if provided no input arrays (indexed)', function test( t ) {
3737
var expected;
3838
var actual;
3939

@@ -44,7 +44,18 @@ tape( 'the function returns an empty array if provided no input arrays', functio
4444
t.end();
4545
});
4646

47-
tape( 'the function returns an empty array if provided empty input arrays', function test( t ) {
47+
tape( 'the function returns an empty array if provided no input arrays (accessors)', function test( t ) {
48+
var expected;
49+
var actual;
50+
51+
actual = zip( toAccessorArray( [] ) );
52+
expected = [];
53+
t.deepEqual( actual, expected, 'returns expected value' );
54+
55+
t.end();
56+
});
57+
58+
tape( 'the function returns an empty array if provided empty input arrays (indexed)', function test( t ) {
4859
var expected;
4960
var actual;
5061

@@ -55,6 +66,20 @@ tape( 'the function returns an empty array if provided empty input arrays', func
5566
t.end();
5667
});
5768

69+
tape( 'the function returns an empty array if provided empty input arrays (accessors)', function test( t ) {
70+
var expected;
71+
var actual;
72+
var x;
73+
74+
x = toAccessorArray( [ toAccessorArray( [] ), toAccessorArray( [] ) ] );
75+
76+
actual = zip( x );
77+
expected = [];
78+
t.deepEqual( actual, expected, 'returns expected value' );
79+
80+
t.end();
81+
});
82+
5883
tape( 'the function zips one array to an array of arrays (indexed)', function test( t ) {
5984
var expected;
6085
var actual;

0 commit comments

Comments
 (0)