Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/node_modules/@stdlib/blas/ext/circshift/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
var nonCoreShape = require( '@stdlib/ndarray/base/complement-shape' );
var getShape = require( '@stdlib/ndarray/shape' );
var getOrder = require( '@stdlib/ndarray/order' );
var defaults = require( '@stdlib/ndarray/defaults' );

Check warning on line 31 in lib/node_modules/@stdlib/blas/ext/circshift/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

only the `get` property of the required module is used; require the property directly
var format = require( '@stdlib/string/format' );
var base = require( './base.js' );

Expand All @@ -53,6 +53,7 @@
* @throws {RangeError} dimension indices must not exceed input ndarray bounds
* @throws {RangeError} number of dimension indices must not exceed the number of input ndarray dimensions
* @throws {Error} must provide valid options
* @throws {Error} second argument must be broadcast-compatible with the non-core dimensions of the first argument
* @returns {ndarray} input ndarray
*
* @example
Expand Down Expand Up @@ -81,12 +82,12 @@
if ( nargs === 2 ) {
// Case: circshift( x, k_scalar )
if ( isInteger( k ) ) {
return base( x, broadcastScalar( k, DEFAULT_DTYPE, [], getOrder( x ) ) );

Check warning on line 85 in lib/node_modules/@stdlib/blas/ext/circshift/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

This line has a length of 85. Maximum allowed is 80
}
// Case: circshift( x, k_ndarray )
if ( isndarrayLike( k ) ) {
// As the operation is performed across all dimensions, `k` is assumed to be a zero-dimensional ndarray...
return base( x, k );
return base( x, maybeBroadcastArray( k, [] ) );
}
throw new TypeError( format( 'invalid argument. Second argument must be either an ndarray or an integer. Value: `%s`.', k ) );
}
Expand All @@ -108,7 +109,7 @@
if ( hasOwnProp( opts, 'dims' ) ) {
ka = maybeBroadcastArray( k, nonCoreShape( getShape( x ), opts.dims ) ); // eslint-disable-line max-len
} else {
ka = k;
ka = maybeBroadcastArray( k, [] );
}
} else {
throw new TypeError( format( 'invalid argument. Second argument must be either an ndarray or an integer. Value: `%s`.', k ) );
Expand Down