Skip to content

Commit 7050b93

Browse files
committed
Auto-generated commit
1 parent 6fdd877 commit 7050b93

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,8 @@ A total of 27 issues were closed in this release:
602602

603603
<details>
604604

605+
- [`06be0fa`](https://github.com/stdlib-js/stdlib/commit/06be0fad3ca61038f88e603e39e33504be481ed8) - **refactor:** use base constructor and fix comments _(by Athan Reines)_
606+
- [`6c6b466`](https://github.com/stdlib-js/stdlib/commit/6c6b466ce5d2dff9110a56322009f3d7f1944f8b) - **refactor:** use base constructor _(by Athan Reines)_
605607
- [`9889c81`](https://github.com/stdlib-js/stdlib/commit/9889c81a20c4f0d6115dcf2f65a1bf9f1072cf26) - **refactor:** remove unnecessary variable _(by Athan Reines)_
606608
- [`0023e16`](https://github.com/stdlib-js/stdlib/commit/0023e164329d4c737ab86ea2654adec96a217f86) - **refactor:** update error message _(by Athan Reines)_
607609
- [`157f4f4`](https://github.com/stdlib-js/stdlib/commit/157f4f4cd7cc3ce680dbfb538b3d8cbcfe5852dd) - **docs:** update comments _(by Athan Reines)_

flatten-by/docs/types/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function identity( x: any ): any {
149149
flattenBy( x, [ 1 ], identity, {} ); // $ExpectError
150150
}
151151

152-
// The compiler throws an error if the function is provided a second argument with invalid `depth` option...
152+
// The compiler throws an error if the function is provided a second argument with an invalid `depth` option...
153153
{
154154
const x = zeros( 'generic', [ 2, 2, 2 ], 'row-major' );
155155

@@ -166,7 +166,7 @@ function identity( x: any ): any {
166166
flattenBy( x, { 'depth': [ 1 ] }, identity, {} ); // $ExpectError
167167
}
168168

169-
// The compiler throws an error if the function is provided a second argument with invalid `order` option...
169+
// The compiler throws an error if the function is provided a second argument with an invalid `order` option...
170170
{
171171
const x = zeros( 'generic', [ 2, 2, 2 ], 'row-major' );
172172

@@ -183,7 +183,7 @@ function identity( x: any ): any {
183183
flattenBy( x, { 'order': [ 1 ] }, identity, {} ); // $ExpectError
184184
}
185185

186-
// The compiler throws an error if the function is provided a second argument with invalid `dtype` option...
186+
// The compiler throws an error if the function is provided a second argument with an invalid `dtype` option...
187187
{
188188
const x = zeros( 'generic', [ 2, 2, 2 ], 'row-major' );
189189

flatten-by/lib/main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ var shape2strides = require( './../../base/shape2strides' );
3535
var strides2order = require( './../../base/strides2order' );
3636
var flattenShape = require( './../../base/flatten-shape' );
3737
var map = require( './../../base/map' );
38+
var ndarray = require( './../../base/ctor' );
3839
var emptyLike = require( './../../empty-like' );
39-
var ndarray = require( './../../ctor' );
4040
var format = require( '@stdlib/string/format' );
4141

4242

@@ -179,12 +179,13 @@ function flattenBy( x, options, fcn, thisArg ) {
179179
'dtype': opts.dtype
180180
});
181181

182-
// Create a view on top of output ndarray having the same shape as the input ndarray:
182+
// Create a view on top of the output ndarray having the same shape as the input ndarray:
183183
st = ( xsh.length > 0 ) ? shape2strides( xsh, opts.order ) : [ 0 ];
184-
view = ndarray( opts.dtype, getData( y ), xsh, st, 0, opts.order );
184+
view = new ndarray( opts.dtype, getData( y ), xsh, st, 0, opts.order );
185185

186186
// Transform and assign elements to the output ndarray:
187187
map( [ x, view ], cb, ctx );
188+
188189
return y;
189190
}
190191

flatten/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ var shape2strides = require( './../../base/shape2strides' );
3434
var strides2order = require( './../../base/strides2order' );
3535
var flattenShape = require( './../../base/flatten-shape' );
3636
var assign = require( './../../base/assign' );
37+
var ndarray = require( './../../base/ctor' );
3738
var emptyLike = require( './../../empty-like' );
38-
var ndarray = require( './../../ctor' );
3939
var format = require( '@stdlib/string/format' );
4040

4141

@@ -349,7 +349,7 @@ function flatten( x, options ) {
349349

350350
// Create a view on top of the output ndarray having the same shape as the input ndarray:
351351
st = ( xsh.length > 0 ) ? shape2strides( xsh, opts.order ) : [ 0 ];
352-
view = ndarray( opts.dtype, getData( y ), xsh, st, 0, opts.order );
352+
view = new ndarray( opts.dtype, getData( y ), xsh, st, 0, opts.order );
353353

354354
// Copy elements to the output ndarray:
355355
assign( [ x, view ] );

0 commit comments

Comments
 (0)