diff --git a/lib/node_modules/@stdlib/ndarray/shift/README.md b/lib/node_modules/@stdlib/ndarray/shift/README.md
new file mode 100644
index 000000000000..c341f229e3fc
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/shift/README.md
@@ -0,0 +1,173 @@
+
+
+# shift
+
+> Return an array containing a read-only truncated view of an input [`ndarray`][@stdlib/ndarray/ctor] and a read-only view of the first element(s) along a specified dimension.
+
+
+
+
+
+
+
+
+
+
+
+## Usage
+
+```javascript
+var shift = require( '@stdlib/ndarray/shift' );
+```
+
+#### shift( x\[, options] )
+
+Returns an array containing a **read-only** truncated view of an input [`ndarray`][@stdlib/ndarray/ctor] and a **read-only** view of the first element(s) along a specified dimension.
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+
+var x = array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], {
+ 'shape': [ 3, 2 ]
+});
+// returns
+
+var arr = ndarray2array( x );
+// returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+
+var y = shift( x );
+// returns [ , ]
+
+arr = ndarray2array( y[ 0 ] );
+// returns [ [ 2.0], [ 4.0 ], [ 6.0 ] ]
+
+arr = ndarray2array( y[ 1 ] );
+// returns [ [ 1.0 ], [ 3.0 ], [ 5.0 ] ]
+```
+
+The function accepts the following arguments:
+
+- **x**: input ndarray. Must have one or more dimensions.
+- **options**: function options (_optional_).
+
+The function supports the following `options`:
+
+- **dim**: dimension along which to perform the operation. If provided an integer less than zero, the dimension index is resolved relative to the last dimension, with the last dimension corresponding to the value `-1`. Default: `-1`.
+
+By default, the function performs operation along the last dimension of the input [`ndarray`][@stdlib/ndarray/ctor]. To perform operation along a specific dimension, provide the `dim` option.
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+
+var x = array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], {
+ 'shape': [ 3, 2 ]
+});
+// returns
+
+var arr = ndarray2array( x );
+// returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+
+var opts = {
+ 'dim': 0
+};
+
+var y = shift( x, opts );
+// returns [ , ]
+
+arr = ndarray2array( y[ 0 ] );
+// returns [ [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+
+arr = ndarray2array( y[ 1 ] );
+// returns [ [ 1.0, 2.0 ] ]
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var zeroTo = require( '@stdlib/array/zero-to' );
+var shift = require( '@stdlib/ndarray/shift' );
+
+// Create an ndarray:
+var x = array( zeroTo( 27 ), {
+ 'shape': [ 3, 3, 3 ]
+});
+console.log( ndarray2array( x ) );
+
+// Remove the first column from each matrix:
+var y = shift( x );
+
+console.log( ndarray2array( y[ 0 ] ) );
+console.log( ndarray2array( y[ 1 ] ) );
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/ctor
+
+
+
+
diff --git a/lib/node_modules/@stdlib/ndarray/shift/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/shift/benchmark/benchmark.js
new file mode 100644
index 000000000000..4d0f3ec6214a
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/shift/benchmark/benchmark.js
@@ -0,0 +1,190 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var empty = require( '@stdlib/ndarray/empty' );
+var pkg = require( './../package.json' ).name;
+var shift = require( './../lib' );
+
+
+// MAIN //
+
+bench( pkg+'::1d', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ values = [
+ empty( [ 2 ], { 'dtype': 'float64' } ),
+ empty( [ 2 ], { 'dtype': 'float32' } ),
+ empty( [ 2 ], { 'dtype': 'int32' } ),
+ empty( [ 2 ], { 'dtype': 'complex128' } ),
+ empty( [ 2 ], { 'dtype': 'generic' } )
+ ];
+
+ /* eslint-enable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = shift( values[ i%values.length ] );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an array of ndarrays' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v[0] ) || !isndarrayLike( v[1] ) ) {
+ b.fail( 'should return an array of ndarrays' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::2d', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ values = [
+ empty( [ 2, 2 ], { 'dtype': 'float64' } ),
+ empty( [ 2, 2 ], { 'dtype': 'float32' } ),
+ empty( [ 2, 2 ], { 'dtype': 'int32' } ),
+ empty( [ 2, 2 ], { 'dtype': 'complex128' } ),
+ empty( [ 2, 2 ], { 'dtype': 'generic' } )
+ ];
+
+ /* eslint-enable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = shift( values[ i%values.length ] );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an array of ndarrays' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v[0] ) || !isndarrayLike( v[1] ) ) {
+ b.fail( 'should return an array of ndarrays' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::3d', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ values = [
+ empty( [ 2, 2, 2 ], { 'dtype': 'float64' } ),
+ empty( [ 2, 2, 2 ], { 'dtype': 'float32' } ),
+ empty( [ 2, 2, 2 ], { 'dtype': 'int32' } ),
+ empty( [ 2, 2, 2 ], { 'dtype': 'complex128' } ),
+ empty( [ 2, 2, 2 ], { 'dtype': 'generic' } )
+ ];
+
+ /* eslint-enable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = shift( values[ i%values.length ] );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an array of ndarrays' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v[0] ) || !isndarrayLike( v[1] ) ) {
+ b.fail( 'should return an array of ndarrays' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::4d', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ values = [
+ empty( [ 2, 2, 2, 2 ], { 'dtype': 'float64' } ),
+ empty( [ 2, 2, 2, 2 ], { 'dtype': 'float32' } ),
+ empty( [ 2, 2, 2, 2 ], { 'dtype': 'int32' } ),
+ empty( [ 2, 2, 2, 2 ], { 'dtype': 'complex128' } ),
+ empty( [ 2, 2, 2, 2 ], { 'dtype': 'generic' } )
+ ];
+
+ /* eslint-enable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = shift( values[ i%values.length ] );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an array of ndarrays' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v[0] ) || !isndarrayLike( v[1] ) ) {
+ b.fail( 'should return an array of ndarrays' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::5d', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ values = [
+ empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float64' } ),
+ empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float32' } ),
+ empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'int32' } ),
+ empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'complex128' } ),
+ empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'generic' } )
+ ];
+
+ /* eslint-enable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = shift( values[ i%values.length ] );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an array of ndarrays' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v[0] ) || !isndarrayLike( v[1] ) ) {
+ b.fail( 'should return an array of ndarrays' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
diff --git a/lib/node_modules/@stdlib/ndarray/shift/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/shift/docs/repl.txt
new file mode 100644
index 000000000000..0632b4824050
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/shift/docs/repl.txt
@@ -0,0 +1,38 @@
+
+{{alias}}( x[, options] )
+ Returns an array containing a read-only truncated view of an input ndarray
+ and a read-only view of the first element(s) along a specified dimension.
+
+ Parameters
+ ----------
+ x: ndarray
+ Input array. Must have one or more dimensions.
+
+ options: object (optional)
+ Options.
+
+ options.dim: integer (optional)
+ Dimension along which to perform the operation. If provided an integer
+ less than zero, the dimension index is resolved relative to the last
+ dimension, with the last dimension corresponding to the value `-1`.
+ Default: -1.
+
+ Returns
+ -------
+ out: Array
+ An array containing a read-only truncated view of an input ndarray and a
+ read-only view of the first element(s) along a specified dimension.
+
+ Examples
+ --------
+ > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] )
+
+ > var y = {{alias}}( x )
+ [ , ]
+ > {{alias:@stdlib/ndarray/to-array}}( y[0] )
+ [ [ 2 ], [ 4 ] ]
+ > {{alias:@stdlib/ndarray/to-array}}( y[1] )
+ [ [ 1 ], [ 3 ] ]
+
+ See Also
+ --------
diff --git a/lib/node_modules/@stdlib/ndarray/shift/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/shift/docs/types/index.d.ts
new file mode 100644
index 000000000000..223ac3dee4bf
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/shift/docs/types/index.d.ts
@@ -0,0 +1,81 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+// TypeScript Version: 4.1
+
+///
+
+import { ndarray } from '@stdlib/types/ndarray';
+
+/**
+* Interface defining function options.
+*/
+interface Options {
+ /**
+ * Dimension along which to perform the operation. Default: `-1`.
+ *
+ * ## Notes
+ *
+ * - If provided an integer less than zero, the dimension index is resolved relative to the last dimension, with the last dimension corresponding to the value `-1`.
+ */
+ dim?: number;
+}
+
+/**
+* Returns an array containing a read-only truncated view of an input ndarray and a read-only view of the first element(s) along a specified dimension.
+*
+* ## Notes
+*
+* - The input array must have one or more dimensions.
+*
+* @param x - input array
+* @param options - function options
+* @param options.dim - dimension along which to perform the operation
+* @returns a list of ndarrays
+*
+* @example
+* var Float64Array = require( '@stdlib/array/float64' );
+* var ndarray = require( '@stdlib/ndarray/ctor' );
+* var ndarray2array = require( '@stdlib/ndarray/to-array' );
+*
+* var buffer = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+* var shape = [ 3, 2 ];
+* var strides = [ 2, 1 ];
+* var offset = 0;
+*
+* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );
+* // returns
+*
+* var arr = ndarray2array( x );
+* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+*
+* var y = shift( x );
+* // returns [ , ]
+*
+* arr = ndarray2array( y[ 0 ] );
+* // returns [ [ 2.0 ], [ 4.0 ], [ 6.0 ] ]
+*
+* arr = ndarray2array( y[ 1 ] );
+* // returns [ [ 1.0 ], [ 3.0 ], [ 5.0 ] ]
+*/
+declare function shift( x: T, options?: Options ): [ T, T ];
+
+
+// EXPORTS //
+
+export = shift;
diff --git a/lib/node_modules/@stdlib/ndarray/shift/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/shift/docs/types/test.ts
new file mode 100644
index 000000000000..d6bab2682ec7
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/shift/docs/types/test.ts
@@ -0,0 +1,91 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import empty = require( '@stdlib/ndarray/base/empty' );
+import shift = require( './index' );
+
+
+// TESTS //
+
+// The function returns an array of ndarrays...
+{
+ const order = 'row-major';
+ const sh = [ 2, 2 ];
+
+ shift( empty( 'float64', sh, order ) ); // $ExpectType [float64ndarray, float64ndarray]
+ shift( empty( 'complex64', sh, order ) ); // $ExpectType [complex64ndarray, complex64ndarray]
+ shift( empty( 'uint8', sh, order ) ); // $ExpectType [uint8ndarray, uint8ndarray]
+
+ shift( empty( 'float64', sh, order ), {} ); // $ExpectType [float64ndarray, float64ndarray]
+ shift( empty( 'complex64', sh, order ), {} ); // $ExpectType [complex64ndarray, complex64ndarray]
+ shift( empty( 'uint8', sh, order ), {} ); // $ExpectType [uint8ndarray, uint8ndarray]
+}
+
+// The compiler throws an error if the function is provided a first argument which is not an ndarray...
+{
+ shift( '10' ); // $ExpectError
+ shift( 10 ); // $ExpectError
+ shift( false ); // $ExpectError
+ shift( true ); // $ExpectError
+ shift( null ); // $ExpectError
+ shift( [] ); // $ExpectError
+ shift( {} ); // $ExpectError
+ shift( ( x: number ): number => x ); // $ExpectError
+
+ shift( '10', {} ); // $ExpectError
+ shift( 10, {} ); // $ExpectError
+ shift( false, {} ); // $ExpectError
+ shift( true, {} ); // $ExpectError
+ shift( null, {} ); // $ExpectError
+ shift( [], {} ); // $ExpectError
+ shift( {}, {} ); // $ExpectError
+ shift( ( x: number ): number => x, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an options argument which is not an object...
+{
+ const x = empty( 'float64', [ 2, 2 ], 'row-major' );
+
+ shift( x, '5' ); // $ExpectError
+ shift( x, false ); // $ExpectError
+ shift( x, true ); // $ExpectError
+ shift( x, null ); // $ExpectError
+ shift( x, [ '5' ] ); // $ExpectError
+ shift( x, ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an options argument with an invalid `dim` option...
+{
+ const x = empty( 'float64', [ 2, 2 ], 'row-major' );
+
+ shift( x, { 'dim': '5' } ); // $ExpectError
+ shift( x, { 'dim': false } ); // $ExpectError
+ shift( x, { 'dim': true } ); // $ExpectError
+ shift( x, { 'dim': null } ); // $ExpectError
+ shift( x, { 'dim': [ '5' ] } ); // $ExpectError
+ shift( x, { 'dim': {} } ); // $ExpectError
+ shift( x, { 'dim': ( x: number ): number => x } ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const x = empty( 'float64', [ 2, 2 ], 'row-major' );
+
+ shift();
+ shift( x, {}, {} ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/ndarray/shift/examples/index.js b/lib/node_modules/@stdlib/ndarray/shift/examples/index.js
new file mode 100644
index 000000000000..e5537c42d507
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/shift/examples/index.js
@@ -0,0 +1,36 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+var array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var zeroTo = require( '@stdlib/array/zero-to' );
+var shift = require( './../lib' );
+
+// Create an ndarray:
+var x = array( zeroTo( 27 ), {
+ 'shape': [ 3, 3, 3 ]
+});
+console.log( ndarray2array( x ) );
+
+// Remove the first column from each matrix:
+var y = shift( x );
+
+console.log( ndarray2array( y[ 0 ] ) );
+console.log( ndarray2array( y[ 1 ] ) );
diff --git a/lib/node_modules/@stdlib/ndarray/shift/lib/index.js b/lib/node_modules/@stdlib/ndarray/shift/lib/index.js
new file mode 100644
index 000000000000..5985725cdbee
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/shift/lib/index.js
@@ -0,0 +1,59 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+/**
+* Return an array containing a read-only truncated view of an input ndarray and a read-only view of the first element(s) along a specified dimension.
+*
+* @module @stdlib/ndarray/shift
+*
+* @example
+* var ndarray = require( '@stdlib/ndarray/ctor' );
+* var ndarray2array = require( '@stdlib/ndarray/to-array' );
+* var shift = require( '@stdlib/ndarray/shift' );
+*
+* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
+* var shape = [ 3, 2 ];
+* var strides = [ 2, 1 ];
+* var offset = 0;
+*
+* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
+* // returns
+*
+* var arr = ndarray2array( x );
+* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+*
+* var y = shift( x );
+* // returns [ , ]
+*
+* arr = ndarray2array( y[ 0 ] );
+* // returns [ [ 2.0 ], [ 4.0 ], [ 6.0 ] ]
+*
+* arr = ndarray2array( y[ 1 ] );
+* // returns [ [ 1.0 ], [ 3.0 ], [ 5.0 ] ]
+*/
+
+// MODULES //
+
+var main = require( './main.js' );
+
+
+// EXPORTS //
+
+module.exports = main;
diff --git a/lib/node_modules/@stdlib/ndarray/shift/lib/main.js b/lib/node_modules/@stdlib/ndarray/shift/lib/main.js
new file mode 100644
index 000000000000..916291112553
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/shift/lib/main.js
@@ -0,0 +1,97 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var isPlainObject = require( '@stdlib/assert/is-plain-object' );
+var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var hasOwnProp = require( '@stdlib/assert/has-own-property' );
+var base = require( '@stdlib/ndarray/base/shift' );
+var format = require( '@stdlib/string/format' );
+
+
+// MAIN //
+
+/**
+* Returns an array containing a read-only truncated view of an input ndarray and a read-only view of the first element(s) along a specified dimension.
+*
+* @param {ndarray} x - input array
+* @param {Object} [options] - function options
+* @param {integer} [options.dim=-1] - dimension along which to perform the operation
+* @throws {TypeError} first argument must be an ndarray having one or more dimensions
+* @throws {RangeError} dimension index exceeds the number of dimensions
+* @throws {TypeError} options argument must be an object
+* * @throws {TypeError} must provide valid options
+* @returns {Array} a list of ndarray views
+*
+* @example
+* var ndarray = require( '@stdlib/ndarray/ctor' );
+* var ndarray2array = require( '@stdlib/ndarray/to-array' );
+*
+* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
+* var shape = [ 3, 2 ];
+* var strides = [ 2, 1 ];
+* var offset = 0;
+*
+* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
+* // returns
+*
+* var arr = ndarray2array( x );
+* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+*
+* var y = shift( x );
+* // returns [ , ]
+*
+* arr = ndarray2array( y[ 0 ] );
+* // returns [ [ 2.0 ], [ 4.0 ], [ 6.0 ] ]
+*
+* arr = ndarray2array( y[ 1 ] );
+* // returns [ [ 1.0 ], [ 3.0 ], [ 5.0 ] ]
+*/
+function shift( x ) {
+ var options;
+ var opts;
+
+ if ( !isndarrayLike( x ) ) {
+ throw new TypeError( format( 'invalid argument. First argument must be an ndarray. Value: `%s`.', x ) );
+ }
+ opts = {
+ 'dim': -1
+ };
+ if ( arguments.length > 1 ) {
+ options = arguments[ 1 ];
+ if ( !isPlainObject( options ) ) {
+ throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
+ }
+ if ( hasOwnProp( options, 'dim' ) ) {
+ if ( !isInteger( options.dim ) ) {
+ throw new TypeError( format( 'invalid option. `%s` option must be an integer. Option: `%s`.', 'strict', options.dim ) );
+ }
+ opts.dim = options.dim;
+ }
+ }
+ return base( x, opts.dim, false );
+}
+
+
+// EXPORTS //
+
+module.exports = shift;
diff --git a/lib/node_modules/@stdlib/ndarray/shift/package.json b/lib/node_modules/@stdlib/ndarray/shift/package.json
new file mode 100644
index 000000000000..3c9002d93fb4
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/shift/package.json
@@ -0,0 +1,67 @@
+{
+ "name": "@stdlib/ndarray/shift",
+ "version": "0.0.0",
+ "description": "Return an array containing a read-only truncated view of an input ndarray and a read-only view of the first element(s) along a specified dimension.",
+ "license": "Apache-2.0",
+ "author": {
+ "name": "The Stdlib Authors",
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
+ },
+ "contributors": [
+ {
+ "name": "The Stdlib Authors",
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
+ }
+ ],
+ "main": "./lib",
+ "directories": {
+ "benchmark": "./benchmark",
+ "doc": "./docs",
+ "example": "./examples",
+ "lib": "./lib",
+ "test": "./test"
+ },
+ "types": "./docs/types",
+ "scripts": {},
+ "homepage": "https://github.com/stdlib-js/stdlib",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/stdlib-js/stdlib.git"
+ },
+ "bugs": {
+ "url": "https://github.com/stdlib-js/stdlib/issues"
+ },
+ "dependencies": {},
+ "devDependencies": {},
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "keywords": [
+ "stdlib",
+ "stdtypes",
+ "types",
+ "base",
+ "data",
+ "structure",
+ "vector",
+ "ndarray",
+ "matrix",
+ "slice",
+ "shift",
+ "view",
+ "remove",
+ "truncate"
+ ]
+}
diff --git a/lib/node_modules/@stdlib/ndarray/shift/test/test.js b/lib/node_modules/@stdlib/ndarray/shift/test/test.js
new file mode 100644
index 000000000000..7fdfd4442968
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/shift/test/test.js
@@ -0,0 +1,541 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' );
+var zeroTo = require( '@stdlib/array/base/zero-to' );
+var zeros = require( '@stdlib/ndarray/zeros' );
+var getShape = require( '@stdlib/ndarray/shape' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var ndarray = require( '@stdlib/ndarray/ctor' );
+var shift = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof shift, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function throws an error if provided a first argument which is not an ndarray', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ '5',
+ 5,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ {},
+ function noop() {}
+ ];
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ shift( value );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a first argument which is not an ndarray (options)', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ '5',
+ 5,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ {},
+ function noop() {}
+ ];
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ shift( value, {} );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided an options argument which is not an object', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ '5',
+ 5,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ function noop() {}
+ ];
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ shift( zeros( [ 2, 2 ] ), value );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided an options argument with an invalid `dim` option', function test( t ) {
+ var values;
+ var opts;
+ var i;
+
+ values = [
+ '5',
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ function noop() {}
+ ];
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ opts = {
+ 'dim': value
+ };
+ shift( zeros( [ 2, 2 ] ), opts );
+ };
+ }
+});
+
+tape( 'the function throws an error if the dimension index exceeds the number of dimensions', function test( t ) {
+ var values;
+ var opts;
+ var i;
+
+ values = [
+ zeros( [ 1 ] ),
+ zeros( [ 1, 1 ] ),
+ zeros( [ 1, 1, 1 ] ),
+ zeros( [ 1, 1, 1, 1 ] )
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ], 10 ), RangeError, 'throws an error when provided ' + values[ i ].shape.join( 'x' ) );
+ t.throws( badValue( values[ i ], -10 ), RangeError, 'throws an error when provided ' + values[ i ].shape.join( 'x' ) );
+ }
+ t.end();
+
+ function badValue( x, dim ) {
+ return function badValue() {
+ opts = {
+ 'dim': dim
+ };
+ shift( x, opts );
+ };
+ }
+});
+
+tape( 'the function returns an array containing ndarrays (ndims=1)', function test( t ) {
+ var actual;
+ var buf;
+ var ord;
+ var sh;
+ var st;
+ var o;
+ var x;
+
+ buf = zeroTo( 6, 'float64' );
+ sh = [ 6 ];
+ st = [ 1 ];
+ o = 0;
+ ord = 'row-major';
+
+ x = new ndarray( 'float64', buf, sh, st, o, ord );
+
+ actual = shift( x );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 5 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 1 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [ 1, 2, 3, 4, 5 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [ 0 ], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns an array containing ndarrays (ndims=1, options)', function test( t ) {
+ var actual;
+ var opts;
+ var buf;
+ var ord;
+ var sh;
+ var st;
+ var o;
+ var x;
+
+ buf = zeroTo( 6, 'float64' );
+ sh = [ 6 ];
+ st = [ 1 ];
+ o = 0;
+ ord = 'row-major';
+
+ x = new ndarray( 'float64', buf, sh, st, o, ord );
+ opts = {
+ 'dim': 0
+ };
+
+ actual = shift( x, opts );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 5 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 1 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [ 1, 2, 3, 4, 5 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [ 0 ], 'returns expected value' );
+
+ opts = {
+ 'dim': -1
+ };
+ actual = shift( x, opts );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 5 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 1 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [ 1, 2, 3, 4, 5 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [ 0 ], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns an array containing ndarrays (ndims=2)', function test( t ) {
+ var actual;
+ var buf;
+ var ord;
+ var sh;
+ var st;
+ var o;
+ var x;
+
+ buf = zeroTo( 8, 'float64' );
+ sh = [ 2, 4 ];
+ st = [ 4, 1 ];
+ o = 0;
+ ord = 'row-major';
+
+ x = new ndarray( 'float64', buf, sh, st, o, ord );
+
+ actual = shift( x );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 2, 3 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 2, 1 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [ [ 1, 2, 3 ], [ 5, 6, 7 ] ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [ [ 0 ], [ 4 ] ], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns an array containing ndarrays (ndims=2, options)', function test( t ) {
+ var actual;
+ var opts;
+ var buf;
+ var ord;
+ var sh;
+ var st;
+ var o;
+ var x;
+
+ buf = zeroTo( 8, 'float64' );
+ sh = [ 2, 4 ];
+ st = [ 4, 1 ];
+ o = 0;
+ ord = 'row-major';
+
+ x = new ndarray( 'float64', buf, sh, st, o, ord );
+ opts = {
+ 'dim': 0
+ };
+
+ actual = shift( x, opts );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 1, 4 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 1, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [ [ 4, 5, 6, 7] ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [ [ 0, 1, 2, 3 ] ], 'returns expected value' );
+
+ opts = {
+ 'dim': -1
+ };
+ actual = shift( x, opts );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 2, 3 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 2, 1 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [ [ 1, 2, 3 ], [ 5, 6, 7 ] ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [ [ 0 ], [ 4 ] ], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns an array containing ndarrays (ndims=3)', function test( t ) {
+ var actual;
+ var buf;
+ var ord;
+ var sh;
+ var st;
+ var o;
+ var x;
+
+ buf = zeroTo( 8, 'float64' );
+ sh = [ 2, 2, 2 ];
+ st = [ 4, 2, 1 ];
+ o = 0;
+ ord = 'row-major';
+
+ /*
+ * [
+ * [
+ * [ 0, 1 ],
+ * [ 2, 3 ]
+ * ],
+ * [
+ * [ 4, 5 ],
+ * [ 6, 7 ]
+ * ]
+ *];
+ */
+ x = new ndarray( 'float64', buf, sh, st, o, ord );
+
+ actual = shift( x );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 2, 2, 1 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 2, 2, 1 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [ [ [ 1 ], [ 3 ] ], [ [ 5 ], [ 7 ] ] ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [ [ [ 0 ], [ 2 ] ], [ [ 4 ], [ 6 ] ] ], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns an array containing ndarrays (ndims=3, options)', function test( t ) {
+ var actual;
+ var opts;
+ var buf;
+ var ord;
+ var sh;
+ var st;
+ var o;
+ var x;
+
+ buf = zeroTo( 8, 'float64' );
+ sh = [ 2, 2, 2 ];
+ st = [ 4, 2, 1 ];
+ o = 0;
+ ord = 'row-major';
+
+ /*
+ * [
+ * [
+ * [ 0, 1 ],
+ * [ 2, 3 ]
+ * ],
+ * [
+ * [ 4, 5 ],
+ * [ 6, 7 ]
+ * ]
+ *];
+ */
+ x = new ndarray( 'float64', buf, sh, st, o, ord );
+
+ opts = {
+ 'dim': 0
+ };
+ actual = shift( x, opts );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 1, 2, 2 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 1, 2, 2 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [ [ [ 4, 5 ], [ 6, 7 ] ] ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [ [ [ 0, 1 ], [ 2, 3 ] ] ], 'returns expected value' );
+
+ opts = {
+ 'dim': -2
+ };
+ actual = shift( x, opts );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 2, 1, 2 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 2, 1, 2 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [ [ [ 2, 3 ] ], [ [ 6, 7 ] ] ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [ [ [ 0, 1 ] ], [ [ 4, 5 ] ] ], 'returns expected value' );
+
+ opts = {
+ 'dim': 2
+ };
+ actual = shift( x, opts );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 2, 2, 1 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 2, 2, 1 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [ [ [ 1 ], [ 3 ] ], [ [ 5 ], [ 7 ] ] ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [ [ [ 0 ], [ 2 ] ], [ [ 4 ], [ 6 ] ] ], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns empty views if provided an empty array (ndims=2)', function test( t ) {
+ var actual;
+ var buf;
+ var ord;
+ var sh;
+ var st;
+ var o;
+ var x;
+
+ buf = zeroTo( 8, 'float64' );
+ st = [ 4, 1 ];
+ o = 0;
+ ord = 'row-major';
+
+ sh = [ 2, 0 ];
+ x = new ndarray( 'float64', buf, sh, st, o, ord );
+
+ actual = shift( x );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 2, 0 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 2, 0 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns empty views if provided an empty array (ndims=2, options)', function test( t ) {
+ var actual;
+ var opts;
+ var buf;
+ var ord;
+ var sh;
+ var st;
+ var o;
+ var x;
+
+ buf = zeroTo( 8, 'float64' );
+ st = [ 4, 1 ];
+ o = 0;
+ ord = 'row-major';
+
+ sh = [ 2, 0 ];
+ x = new ndarray( 'float64', buf, sh, st, o, ord );
+ opts = {
+ 'dim': 0
+ };
+ actual = shift( x, opts );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 1, 0 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 1, 0 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [], 'returns expected value' );
+
+ opts = {
+ 'dim': -1
+ };
+ actual = shift( x, opts );
+
+ t.strictEqual( isndarrayLike( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isndarrayLike( actual[1] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[0] ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( actual[1] ), true, 'returns expected value' );
+ t.deepEqual( getShape( actual[0] ), [ 2, 0 ], 'returns expected value' );
+ t.deepEqual( getShape( actual[1] ), [ 2, 0 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[0] ), [], 'returns expected value' );
+ t.deepEqual( ndarray2array( actual[1] ), [], 'returns expected value' );
+
+ t.end();
+});