Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Oct 8, 2023
1 parent 6812557 commit 90a9e33
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
6 changes: 3 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
// MODULES //

var isReadOnly = require( '@stdlib/ndarray-base-assert-is-read-only' );
var getDType = require( '@stdlib/ndarray-base-dtype' );
var getShape = require( '@stdlib/ndarray-base-shape' );
var getStrides = require( '@stdlib/ndarray-base-strides' );
var getOffset = require( '@stdlib/ndarray-base-offset' );
var getOrder = require( '@stdlib/ndarray-base-order' );
var getData = require( '@stdlib/ndarray-base-data-buffer' );


// MAIN //
Expand Down Expand Up @@ -73,8 +79,8 @@ function removeSingletonDimensions( x ) {
var N;
var i;

sh = x.shape;
st = x.strides;
sh = getShape( x, false );
st = getStrides( x, false );
N = sh.length;

strides = [];
Expand All @@ -93,11 +99,11 @@ function removeSingletonDimensions( x ) {
}
if ( isReadOnly( x ) ) {
// If provided a read-only view, the returned array should also be read-only...
return new x.constructor( x.dtype, x.data, shape, strides, x.offset, x.order, { // eslint-disable-line max-len
return new x.constructor( getDType( x ), getData( x ), shape, strides, getOffset( x ), getOrder( x ), { // eslint-disable-line max-len
'readonly': true
});
}
return new x.constructor( x.dtype, x.data, shape, strides, x.offset, x.order ); // eslint-disable-line max-len
return new x.constructor( getDType( x ), getData( x ), shape, strides, getOffset( x ), getOrder( x ) ); // eslint-disable-line max-len
}


Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
},
"dependencies": {
"@stdlib/ndarray-base-assert-is-read-only": "^0.1.1",
"@stdlib/ndarray-base-data-buffer": "github:stdlib-js/ndarray-base-data-buffer#main",
"@stdlib/ndarray-base-dtype": "github:stdlib-js/ndarray-base-dtype#main",
"@stdlib/ndarray-base-offset": "github:stdlib-js/ndarray-base-offset#main",
"@stdlib/ndarray-base-order": "github:stdlib-js/ndarray-base-order#main",
"@stdlib/ndarray-base-shape": "github:stdlib-js/ndarray-base-shape#main",
"@stdlib/ndarray-base-strides": "github:stdlib-js/ndarray-base-strides#main",
"@stdlib/types": "^0.1.0"
},
"devDependencies": {
Expand Down

0 comments on commit 90a9e33

Please sign in to comment.