diff --git a/lib/node_modules/@stdlib/ndarray/splice/README.md b/lib/node_modules/@stdlib/ndarray/splice/README.md
new file mode 100644
index 000000000000..ac2f703ab247
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/README.md
@@ -0,0 +1,170 @@
+
+
+# splice
+
+> Return an [`ndarray`][@stdlib/ndarray/ctor] where elements of an input [`ndarray`][@stdlib/ndarray/ctor] are replaced or removed along a specific dimension
+
+
+
+
+
+
+
+
+
+
+
+## Usage
+
+```javascript
+var splice = require( '@stdlib/ndarray/splice' );
+```
+
+#### splice( x, slice\[, values\[, options]] )
+
+Returns an [`ndarray`][@stdlib/ndarray/ctor] where elements of an input [`ndarray`][@stdlib/ndarray/ctor] are replaced or removed along a specific dimension.
+
+```javascript
+var Slice = require( '@stdlib/slice/ctor' );
+var array = require( '@stdlib/ndarray/array' );
+
+var x = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] );
+// returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+
+var y = array( [ [ 20.0 ], [ 40.0 ], [ 60.0 ] ] );
+// returns [ [ 20.0 ], [ 40.0 ], [ 60.0 ] ]
+
+var s = new Slice( 1, null, 1 );
+// returns
+
+var out = splice( x, s, y );
+// returns [ [ 1.0, 20.0 ], [ 3.0, 40.0 ], [ 5.0, 60.0 ] ]
+```
+
+The function accepts the following arguments:
+
+- **x**: input [`ndarray`][@stdlib/ndarray/ctor].
+- **slice**: a [`Slice`][@stdlib/slice/ctor] instance, `null`, `undefined`, or an integer. If provided `null` or `undefined`, the argument is equivalent to `new Slice()` (i.e., the returned view should include all elements along a specified dimension). If provided an integer less than zero, the corresponding element along the specified dimension is resolved relative to the last element along that dimension. For negative integers, the last element corresponds to the value `-1`.
+- **values**: an [`ndarray`][@stdlib/ndarray/ctor] containing the elements to insert. Must be [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes] with the slice region (_optional_).
+- **options**: function options (_optional_).
+
+The function accepts the following `options`:
+
+- **dim**: dimension along which to perform the operation. Must be a negative integer. The index is resolved relative to the last dimension, with the last dimension corresponding to the value `-1`. Default: `-1`.
+
+By default, the function performs the operation on the last dimension. To perform the operation on any other dimension, specify the `dim` option.
+
+```javascript
+var Slice = require( '@stdlib/slice/ctor' );
+var array = require( '@stdlib/ndarray/array' );
+
+var x = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] );
+// returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+
+var y = array( [ [ 10.0, 20.0 ] ] );
+// returns [ [ 10.0, 20.0 ] ]
+
+var s = new Slice( 1, 2, 1 );
+// returns
+
+var out = splice( x, s, y, {
+ 'dim': -2
+});
+// returns [ [ 1.0, 2.0 ], [ 10.0, 20.0 ], [ 5.0, 6.0 ] ]
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Examples
+
+```javascript
+var uniform = require( '@stdlib/random/uniform' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var Slice = require( '@stdlib/slice/ctor' );
+var splice = require( '@stdlib/ndarray/splice' );
+
+var x = uniform( [ 3, 3, 3 ], -10, 10 );
+console.log( ndarray2array( x ) );
+
+var s = new Slice( 1, 2, 1 );
+
+var y = uniform( [ 3, 3 ], 20, 40 );
+console.log( 'Values: ', ndarray2array( y ) );
+
+var out = splice( x, s, y, {
+ 'dim': -3
+});
+console.log( ndarray2array( out ) );
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[@stdlib/slice/ctor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/slice/ctor
+
+[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/ctor
+
+[@stdlib/ndarray/base/broadcast-shapes]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/broadcast-shapes
+
+
+
+
+
+
+
+
diff --git a/lib/node_modules/@stdlib/ndarray/splice/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/splice/benchmark/benchmark.js
new file mode 100644
index 000000000000..3345a67783b2
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/benchmark/benchmark.js
@@ -0,0 +1,843 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 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 Slice = require( '@stdlib/slice/ctor' );
+var baseEmpty = require( '@stdlib/ndarray/base/empty' );
+var empty = require( '@stdlib/ndarray/empty' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+var splice = require( './../lib' );
+
+
+// MAIN //
+
+bench( format( '%s::1d,base', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ xvalues = [
+ baseEmpty( 'float64', [ 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2 ], 'row-major' )
+ ];
+ yvalues = [
+ baseEmpty( 'float64', [ 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2 ], 'row-major' )
+ ];
+ s = new Slice( null );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::1d,non-base', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ xvalues = [
+ empty( [ 2 ], { 'dtype': 'float64' } ),
+ empty( [ 2 ], { 'dtype': 'float32' } ),
+ empty( [ 2 ], { 'dtype': 'int32' } ),
+ empty( [ 2 ], { 'dtype': 'complex128' } ),
+ empty( [ 2 ], { 'dtype': 'generic' } )
+ ];
+ yvalues = [
+ 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 */
+
+ s = new Slice( null );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::1d,base,reduced', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ xvalues = [
+ baseEmpty( 'float64', [ 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2 ], 'row-major' )
+ ];
+ yvalues = [
+ baseEmpty( 'float64', [ 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2 ], 'row-major' )
+ ];
+ s = 1;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::1d,non-base,reduced', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ xvalues = [
+ empty( [ 2 ], { 'dtype': 'float64' } ),
+ empty( [ 2 ], { 'dtype': 'float32' } ),
+ empty( [ 2 ], { 'dtype': 'int32' } ),
+ empty( [ 2 ], { 'dtype': 'complex128' } ),
+ empty( [ 2 ], { 'dtype': 'generic' } )
+ ];
+ yvalues = [
+ 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 */
+
+ s = 1;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::2d,base', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ xvalues = [
+ baseEmpty( 'float64', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2 ], 'row-major' )
+ ];
+ yvalues = [
+ baseEmpty( 'float64', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2 ], 'row-major' )
+ ];
+ s = new Slice( null );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::2d,non-base', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ xvalues = [
+ 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' } )
+ ];
+ yvalues = [
+ 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 */
+
+ s = new Slice( null );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::2d,base,reduced', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ xvalues = [
+ baseEmpty( 'float64', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2 ], 'row-major' )
+ ];
+ yvalues = [
+ baseEmpty( 'float64', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2 ], 'row-major' )
+ ];
+ s = 1;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::2d,non-base,reduced', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ xvalues = [
+ 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' } )
+ ];
+ yvalues = [
+ 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 */
+
+ s = 1;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::3d,base', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ xvalues = [
+ baseEmpty( 'float64', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2 ], 'row-major' )
+ ];
+ yvalues = [
+ baseEmpty( 'float64', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2 ], 'row-major' )
+ ];
+ s = new Slice( null );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::3d,non-base', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ xvalues = [
+ 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' } )
+ ];
+ yvalues = [
+ 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 */
+
+ s = new Slice( null );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::3d,base,reduced', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ xvalues = [
+ baseEmpty( 'float64', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2 ], 'row-major' )
+ ];
+ yvalues = [
+ baseEmpty( 'float64', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2 ], 'row-major' )
+ ];
+ s = 1;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::3d,non-base,reduced', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ xvalues = [
+ 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' } )
+ ];
+ yvalues = [
+ 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 */
+
+ s = 1;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::4d,base', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ xvalues = [
+ baseEmpty( 'float64', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2, 2 ], 'row-major' )
+ ];
+ yvalues = [
+ baseEmpty( 'float64', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2, 2 ], 'row-major' )
+ ];
+ s = new Slice( null );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::4d,non-base', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ xvalues = [
+ 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' } )
+ ];
+ yvalues = [
+ 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 */
+
+ s = new Slice( null );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::4d,base,reduced', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ xvalues = [
+ baseEmpty( 'float64', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2, 2 ], 'row-major' )
+ ];
+ yvalues = [
+ baseEmpty( 'float64', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2, 2 ], 'row-major' )
+ ];
+ s = 1;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::4d,non-base,reduced', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ xvalues = [
+ 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' } )
+ ];
+ yvalues = [
+ 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 */
+
+ s = 1;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::5d,base', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ xvalues = [
+ baseEmpty( 'float64', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2, 2, 2 ], 'row-major' )
+ ];
+ yvalues = [
+ baseEmpty( 'float64', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2, 2, 2 ], 'row-major' )
+ ];
+ s = new Slice( null );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::5d,non-base', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ xvalues = [
+ 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' } )
+ ];
+ yvalues = [
+ 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 */
+
+ s = new Slice( null );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::5d,base,reduced', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ xvalues = [
+ baseEmpty( 'float64', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2, 2, 2 ], 'row-major' )
+ ];
+ yvalues = [
+ baseEmpty( 'float64', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2, 2, 2 ], 'row-major' )
+ ];
+ s = 1;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::5d,non-base,reduced', pkg ), function benchmark( b ) {
+ var xvalues;
+ var yvalues;
+ var v;
+ var s;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ xvalues = [
+ 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' } )
+ ];
+ yvalues = [
+ 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 */
+
+ s = 1;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = splice( xvalues[ i%xvalues.length ], s, yvalues[ i%yvalues.length ] ); // eslint-disable-line max-len
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
diff --git a/lib/node_modules/@stdlib/ndarray/splice/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/splice/docs/repl.txt
new file mode 100644
index 000000000000..6a3d99d54089
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/docs/repl.txt
@@ -0,0 +1,45 @@
+
+{{alias}}( x, slice[, values[, options]] )
+ Returns an ndarray where the elements of an input ndarray are replaced or
+ removed along a specific dimension.
+
+ Parameters
+ ----------
+ x: ndarray
+ Input array.
+
+ slice: Slice|integer|null|undefined
+ Slice object or an integer. If provided `null` or `undefined`, the
+ returned view includes all elements along a specified dimension. If
+ provided an integer less than zero, the corresponding element along the
+ specified dimension is resolved relative to the last element along that
+ dimension. For negative integers, the last element corresponds to the
+ value `-1`.
+
+ values: ndarray (optional)
+ Replacing values.
+
+ options: Object (optional)
+ Options.
+
+ options.dim: boolean (optional)
+ Dimension along which to perform the operation. Default: -1.
+
+ Returns
+ -------
+ out: ndarray
+ Output array.
+
+ Examples
+ --------
+ > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] )
+ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]
+ > var y = {{alias:@stdlib/ndarray/array}}( [ [ 5.0 ], [ 6.0 ] ] )
+ [ [ 5.0 ], [ 6.0 ] ]
+ > var s = new {{alias:@stdlib/slice/ctor}}( 1, 2, 1 );
+ > var out = {{alias}}( x, s, y )
+ [ [ 1.0, 5.0 ], [ 3.0, 6 ] ]
+
+ See Also
+ --------
+
diff --git a/lib/node_modules/@stdlib/ndarray/splice/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/splice/docs/types/index.d.ts
new file mode 100644
index 000000000000..2579263c1132
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/docs/types/index.d.ts
@@ -0,0 +1,74 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2026 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';
+import { Slice } from '@stdlib/types/slice';
+
+/**
+* Interface defining function options.
+*/
+interface Options {
+ /**
+ * Dimension along which to perform the operation (default: -1).
+ */
+ dim?: number;
+}
+
+/**
+* Slice argument.
+*/
+type SliceArgument = Slice | number | null | undefined;
+
+/**
+* Returns an ndarray where the elements of an input ndarray are replaced or removed along a specific dimension.
+*
+* @param x - input array
+* @param s - slice object or an integer
+* @param values - an ndarray containing the elements to insert
+* @param options - options
+* @param options.dim - dimension along which to perform the operation
+* @returns output ndarray
+*
+* @example
+* var Slice = require( '@stdlib/slice/ctor' );
+* var array = require( '@stdlib/ndarray/array' );
+*
+* var x = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] );
+* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+*
+* var y = array( [ [ 10.0, 20.0 ] ] );
+* // returns [ [ 10.0, 20.0 ] ]
+*
+* var s = new Slice( 1, 2, 1 );
+* // returns
+*
+* var out = splice( x, s, y, {
+* 'dim': -2
+* });
+* // returns [ [ 1.0, 2.0 ], [ 10.0, 20.0 ], [ 5.0, 6.0 ] ]
+*/
+declare function splice( x: T, s: SliceArgument, values?: T, options?: Options ): T;
+
+
+// EXPORTS //
+
+export = splice;
diff --git a/lib/node_modules/@stdlib/ndarray/splice/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/splice/docs/types/test.ts
new file mode 100644
index 000000000000..daa371bd30d7
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/docs/types/test.ts
@@ -0,0 +1,229 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2026 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 Slice = require( '@stdlib/slice/ctor' );
+import splice = require( './index' );
+
+
+// TESTS //
+
+// The function returns an ndarray...
+{
+ const order = 'row-major';
+ const sh = [ 2, 2 ];
+ const s = new Slice( null );
+
+ splice( empty( 'float64', sh, order ), s ); // $ExpectType float64ndarray
+ splice( empty( 'float32', sh, order ), s ); // $ExpectType float32ndarray
+ splice( empty( 'complex128', sh, order ), s ); // $ExpectType complex128ndarray
+ splice( empty( 'complex64', sh, order ), s ); // $ExpectType complex64ndarray
+ splice( empty( 'int32', sh, order ), s ); // $ExpectType int32ndarray
+ splice( empty( 'int16', sh, order ), s ); // $ExpectType int16ndarray
+ splice( empty( 'int8', sh, order ), s ); // $ExpectType int8ndarray
+ splice( empty( 'uint32', sh, order ), s ); // $ExpectType uint32ndarray
+ splice( empty( 'uint16', sh, order ), s ); // $ExpectType uint16ndarray
+ splice( empty( 'uint8', sh, order ), s ); // $ExpectType uint8ndarray
+ splice( empty( 'uint8c', sh, order ), s ); // $ExpectType uint8cndarray
+
+ splice( empty( 'float64', sh, order ), s, empty( 'float64', sh, order ) ); // $ExpectType float64ndarray
+ splice( empty( 'float32', sh, order ), s, empty( 'float32', sh, order ) ); // $ExpectType float32ndarray
+ splice( empty( 'complex128', sh, order ), s, empty( 'complex128', sh, order ) ); // $ExpectType complex128ndarray
+ splice( empty( 'complex64', sh, order ), s, empty( 'complex64', sh, order ) ); // $ExpectType complex64ndarray
+ splice( empty( 'int32', sh, order ), s, empty( 'int32', sh, order ) ); // $ExpectType int32ndarray
+ splice( empty( 'int16', sh, order ), s, empty( 'int16', sh, order ) ); // $ExpectType int16ndarray
+ splice( empty( 'int8', sh, order ), s, empty( 'int8', sh, order ) ); // $ExpectType int8ndarray
+ splice( empty( 'uint32', sh, order ), s, empty( 'uint32', sh, order ) ); // $ExpectType uint32ndarray
+ splice( empty( 'uint16', sh, order ), s, empty( 'uint16', sh, order ) ); // $ExpectType uint16ndarray
+ splice( empty( 'uint8', sh, order ), s, empty( 'uint8', sh, order ) ); // $ExpectType uint8ndarray
+ splice( empty( 'uint8c', sh, order ), s, empty( 'uint8c', sh, order ) ); // $ExpectType uint8cndarray
+
+ splice( empty( 'float64', sh, order ), s, { 'dim': -2 } ); // $ExpectType float64ndarray
+ splice( empty( 'float32', sh, order ), s, { 'dim': -2 } ); // $ExpectType float32ndarray
+ splice( empty( 'complex128', sh, order ), s, { 'dim': -2 } ); // $ExpectType complex128ndarray
+ splice( empty( 'complex64', sh, order ), s, { 'dim': -2 } ); // $ExpectType complex64ndarray
+ splice( empty( 'int32', sh, order ), s, { 'dim': -2 } ); // $ExpectType int32ndarray
+ splice( empty( 'int16', sh, order ), s, { 'dim': -2 } ); // $ExpectType int16ndarray
+ splice( empty( 'int8', sh, order ), s, { 'dim': -2 } ); // $ExpectType int8ndarray
+ splice( empty( 'uint32', sh, order ), s, { 'dim': -2 } ); // $ExpectType uint32ndarray
+ splice( empty( 'uint16', sh, order ), s, { 'dim': -2 } ); // $ExpectType uint16ndarray
+ splice( empty( 'uint8', sh, order ), s, { 'dim': -2 } ); // $ExpectType uint8ndarray
+ splice( empty( 'uint8c', sh, order ), s, { 'dim': -2 } ); // $ExpectType uint8cndarray
+
+ splice( empty( 'float64', sh, order ), s, empty( 'float64', sh, order ), { 'dim': -2 } ); // $ExpectType float64ndarray
+ splice( empty( 'float32', sh, order ), s, empty( 'float32', sh, order ), { 'dim': -2 } ); // $ExpectType float32ndarray
+ splice( empty( 'complex128', sh, order ), s, empty( 'complex128', sh, order ), { 'dim': -2 } ); // $ExpectType complex128ndarray
+ splice( empty( 'complex64', sh, order ), s, empty( 'complex64', sh, order ), { 'dim': -2 } ); // $ExpectType complex64ndarray
+ splice( empty( 'int32', sh, order ), s, empty( 'int32', sh, order ), { 'dim': -2 } ); // $ExpectType int32ndarray
+ splice( empty( 'int16', sh, order ), s, empty( 'int16', sh, order ), { 'dim': -2 } ); // $ExpectType int16ndarray
+ splice( empty( 'int8', sh, order ), s, empty( 'int8', sh, order ), { 'dim': -2 } ); // $ExpectType int8ndarray
+ splice( empty( 'uint32', sh, order ), s, empty( 'uint32', sh, order ), { 'dim': -2 } ); // $ExpectType uint32ndarray
+ splice( empty( 'uint16', sh, order ), s, empty( 'uint16', sh, order ), { 'dim': -2 } ); // $ExpectType uint16ndarray
+ splice( empty( 'uint8', sh, order ), s, empty( 'uint8', sh, order ), { 'dim': -2 } ); // $ExpectType uint8ndarray
+ splice( empty( 'uint8c', sh, order ), s, empty( 'uint8c', sh, order ), { 'dim': -2 } ); // $ExpectType uint8cndarray
+}
+
+// The compiler throws an error if the function is provided a first argument which is not an ndarray...
+{
+ var y = empty( 'float64', [ 2, 2 ], 'row-major' );
+ const s = new Slice( null );
+
+ splice( '10', s ); // $ExpectError
+ splice( 10, s ); // $ExpectError
+ splice( false, s ); // $ExpectError
+ splice( true, s ); // $ExpectError
+ splice( null, s ); // $ExpectError
+ splice( [], s ); // $ExpectError
+ splice( {}, s ); // $ExpectError
+ splice( ( x: number ): number => x, s ); // $ExpectError
+
+ splice( '10', s, y ); // $ExpectError
+ splice( 10, s, y ); // $ExpectError
+ splice( false, s, y ); // $ExpectError
+ splice( true, s, y ); // $ExpectError
+ splice( null, s, y ); // $ExpectError
+ splice( [], s, y ); // $ExpectError
+ splice( {}, s, y ); // $ExpectError
+ splice( ( x: number ): number => x, s, y ); // $ExpectError
+
+ splice( '10', s, {} ); // $ExpectError
+ splice( 10, s, {} ); // $ExpectError
+ splice( false, s, {} ); // $ExpectError
+ splice( true, s, {} ); // $ExpectError
+ splice( null, s, {} ); // $ExpectError
+ splice( [], s, {} ); // $ExpectError
+ splice( {}, s, {} ); // $ExpectError
+ splice( ( x: number ): number => x, s, {} ); // $ExpectError
+
+ splice( '10', s, y, {} ); // $ExpectError
+ splice( 10, s, y, {} ); // $ExpectError
+ splice( false, s, y, {} ); // $ExpectError
+ splice( true, s, y, {} ); // $ExpectError
+ splice( null, s, y, {} ); // $ExpectError
+ splice( [], s, y, {} ); // $ExpectError
+ splice( {}, s, y, {} ); // $ExpectError
+ splice( ( x: number ): number => x, s, y, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a second argument which is not a valid slice argument...
+{
+ const x = empty( 'float64', [ 2, 2 ], 'row-major' );
+ var y = empty( 'float64', [ 2, 2 ], 'row-major' );
+
+ splice( x, '5' ); // $ExpectError
+ splice( x, false ); // $ExpectError
+ splice( x, true ); // $ExpectError
+ splice( x, [ '5' ] ); // $ExpectError
+ splice( x, {} ); // $ExpectError
+ splice( x, ( x: number ): number => x ); // $ExpectError
+
+ splice( x, '5', {} ); // $ExpectError
+ splice( x, false, {} ); // $ExpectError
+ splice( x, true, {} ); // $ExpectError
+ splice( x, [ '5' ], {} ); // $ExpectError
+ splice( x, {}, {} ); // $ExpectError
+ splice( x, ( x: number ): number => x, {} ); // $ExpectError
+
+ splice( x, '5', {} ); // $ExpectError
+ splice( x, false, {} ); // $ExpectError
+ splice( x, true, {} ); // $ExpectError
+ splice( x, [ '5' ], {} ); // $ExpectError
+ splice( x, {}, {} ); // $ExpectError
+ splice( x, ( x: number ): number => x, {} ); // $ExpectError
+
+ splice( x, '5', y, {} ); // $ExpectError
+ splice( x, false, y, {} ); // $ExpectError
+ splice( x, true, y, {} ); // $ExpectError
+ splice( x, [ '5' ], y, {} ); // $ExpectError
+ splice( x, {}, y, {} ); // $ExpectError
+ splice( x, ( x: number ): number => x, y, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a values argument which is not an ndarray...
+{
+ const x = empty( 'float64', [ 2, 2 ], 'row-major' );
+ const s = new Slice( null );
+
+ splice( x, s, '5' ); // $ExpectError
+ splice( x, s, 5 ); // $ExpectError
+ splice( x, s, true ); // $ExpectError
+ splice( x, s, false ); // $ExpectError
+ splice( x, s, null ); // $ExpectError
+ splice( x, s, [ '5' ] ); // $ExpectError
+ splice( x, s, ( x: number ): number => x ); // $ExpectError
+
+ splice( x, s, '5', {} ); // $ExpectError
+ splice( x, s, 5, {} ); // $ExpectError
+ splice( x, s, true, {} ); // $ExpectError
+ splice( x, s, false, {} ); // $ExpectError
+ splice( x, s, null, {} ); // $ExpectError
+ splice( x, s, [ '5' ], {} ); // $ExpectError
+ splice( x, s, ( 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' );
+ const y = empty( 'float64', [ 2, 2 ], 'row-major' );
+ const s = new Slice( null );
+
+ splice( x, s, y, '5' ); // $ExpectError
+ splice( x, s, y, 5 ); // $ExpectError
+ splice( x, s, y, true ); // $ExpectError
+ splice( x, s, y, false ); // $ExpectError
+ splice( x, s, y, null ); // $ExpectError
+ splice( x, s, y, [ '5' ] ); // $ExpectError
+ splice( x, s, y, ( x: number ): number => x ); // $ExpectError
+
+ splice( x, s, '5' ); // $ExpectError
+ splice( x, s, 5 ); // $ExpectError
+ splice( x, s, true ); // $ExpectError
+ splice( x, s, false ); // $ExpectError
+ splice( x, s, null ); // $ExpectError
+ splice( x, s, [ '5' ] ); // $ExpectError
+ splice( x, s, ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a `dim` option which is not a number...
+{
+ const x = empty( 'float64', [ 2, 2 ], 'row-major' );
+ const y = empty( 'float64', [ 2, 2 ], 'row-major' );
+ const s = new Slice( null );
+
+ splice( x, s, { 'dim': '5' } ); // $ExpectError
+ splice( x, s, { 'dim': null } ); // $ExpectError
+ splice( x, s, { 'dim': [ '5' ] } ); // $ExpectError
+ splice( x, s, { 'dim': {} } ); // $ExpectError
+ splice( x, s, { 'dim': ( x: number ): number => x } ); // $ExpectError
+
+ splice( x, s, y, { 'dim': '5' } ); // $ExpectError
+ splice( x, s, y, { 'dim': null } ); // $ExpectError
+ splice( x, s, y, { 'dim': [ '5' ] } ); // $ExpectError
+ splice( x, s, y, { 'dim': {} } ); // $ExpectError
+ splice( x, s, y, { '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' );
+ const y = empty( 'float64', [ 2, 2 ], 'row-major' );
+ const s = new Slice( null );
+
+ splice( x ); // $ExpectError
+ splice( x, s, y, {}, {} ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/ndarray/splice/examples/index.js b/lib/node_modules/@stdlib/ndarray/splice/examples/index.js
new file mode 100644
index 000000000000..9fd61518e1a4
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/examples/index.js
@@ -0,0 +1,37 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 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 uniform = require( '@stdlib/random/uniform' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var Slice = require( '@stdlib/slice/ctor' );
+var splice = require( './../lib' );
+
+var x = uniform( [ 3, 3, 3 ], -10, 10 );
+console.log( ndarray2array( x ) );
+
+var s = new Slice( 1, 2, 1 );
+
+var y = uniform( [ 3, 3 ], 20, 40 );
+console.log( 'Values: ', ndarray2array( y ) );
+
+var out = splice( x, s, y, {
+ 'dim': -3
+});
+console.log( ndarray2array( out ) );
diff --git a/lib/node_modules/@stdlib/ndarray/splice/lib/index.js b/lib/node_modules/@stdlib/ndarray/splice/lib/index.js
new file mode 100644
index 000000000000..41dc9ee124ff
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/lib/index.js
@@ -0,0 +1,53 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 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 ndarray where the elements of an input ndarray are replaced or removed along a specific dimension.
+*
+* @module @stdlib/ndarray/splice
+*
+* @example
+* var Slice = require( '@stdlib/slice/ctor' );
+* var array = require( '@stdlib/ndarray/array' );
+* var splice = require( '@stdlib/ndarray/splice' );
+*
+* var x = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] );
+* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+*
+* var y = array( [ [ 10.0, 20.0 ] ] );
+* // returns [ [ 10.0, 20.0 ] ]
+*
+* var s = new Slice( 1, 2, 1 );
+* // returns
+*
+* var out = splice( x, s, y, {
+* 'dim': -2
+* });
+* // returns [ [ 1.0, 2.0 ], [ 10.0, 20.0 ], [ 5.0, 6.0 ] ]
+*/
+
+// MODULES //
+
+var main = require( './main.js' );
+
+
+// EXPORTS //
+
+module.exports = main;
diff --git a/lib/node_modules/@stdlib/ndarray/splice/lib/main.js b/lib/node_modules/@stdlib/ndarray/splice/lib/main.js
new file mode 100644
index 000000000000..77283a46b083
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/lib/main.js
@@ -0,0 +1,219 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 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 isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var isNegativeInteger = require( '@stdlib/assert/is-negative-integer' );
+var isPlainObject = require( '@stdlib/assert/is-plain-object' );
+var hasOwnProp = require( '@stdlib/assert/has-own-property' );
+var args2multislice = require( '@stdlib/slice/base/args2multislice' );
+var normalizeMultiSlice = require( '@stdlib/slice/base/normalize-multi-slice' );
+var Slice = require( '@stdlib/slice/ctor' );
+var slice = require( '@stdlib/ndarray/slice' );
+var maybeBroadcastArray = require( '@stdlib/ndarray/maybe-broadcast-array' );
+var base = require( '@stdlib/ndarray/concat' );
+var getShape = require( '@stdlib/ndarray/shape' );
+var ndims = require( '@stdlib/ndarray/ndims' );
+var nulls = require( '@stdlib/array/base/nulls' );
+var normalizeIndex = require( '@stdlib/ndarray/base/normalize-index' );
+var format = require( '@stdlib/string/format' );
+
+
+// MAIN //
+
+/**
+* Returns an ndarray where the elements of an input ndarray are replaced or removed along a specific dimension.
+*
+* @param {ndarray} x - input array
+* @param {(Slice|integer)} s - slice object or an integer
+* @param {ndarray} values - an ndarray containing the elements to insert
+* @param {Options} [options] - options
+* @param {integer} [options.dim=-1] - dimension along which to perform the operation
+* @throws {TypeError} first argument must be an ndarray
+* @throws {TypeError} first argument must be an ndarray having one or more dimensions
+* @throws {RangeError} dimension index exceeds the number of dimensions
+* @throws {RangeError} slice exceeds array bounds
+* @throws {TypeError} values argument must be an ndarray
+* @throws {Error} insufficient arguments
+* @throws {Error} too many arguments
+* @throws {TypeError} options argument must be an object
+* @throws {TypeError} must provide valid options
+* @returns {ndarray} output ndarray
+*
+* @example
+* var Slice = require( '@stdlib/slice/ctor' );
+* var array = require( '@stdlib/ndarray/array' );
+*
+* var x = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] );
+* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+*
+* var y = array( [ [ 10.0, 20.0 ] ] );
+* // returns [ [ 10.0, 20.0 ] ]
+*
+* var s = new Slice( 1, 2, 1 );
+* // returns
+*
+* var out = splice( x, s, y, {
+* 'dim': -2
+* });
+* // returns [ [ 1.0, 2.0 ], [ 10.0, 20.0 ], [ 5.0, 6.0 ] ]
+*/
+function splice( x, s ) {
+ var hasValues;
+ var options;
+ var hasOpts;
+ var slices;
+ var nargs;
+ var views;
+ var spdim;
+ var args;
+ var opts;
+ var lvf;
+ var rvf;
+ var sh;
+ var ms;
+ var st;
+ var ed;
+ var v;
+ var N;
+ var S;
+ var i;
+
+ nargs = arguments.length;
+ if ( !isndarrayLike( x ) ) {
+ throw new TypeError( format( 'invalid argument. First argument must be an ndarray. Value: `%s`.', x ) );
+ }
+
+ // Retrieve array meta data:
+ N = ndims( x );
+
+ // Check whether we were provided a zero-dimensional array...
+ if ( N === 0 ) {
+ throw new TypeError( format( 'invalid argument. First argument must be an ndarray having one or more dimensions. Number of dimensions: %d.', N ) );
+ }
+
+ // Resolve function arguments:
+ hasOpts = false;
+ hasValues = false;
+ opts = {
+ 'dim': -1
+ };
+ if ( nargs === 4 ) { // Case: splice( x, s, values, options )
+ options = arguments[ nargs - 1 ];
+ if ( !isPlainObject( options ) ) {
+ throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
+ }
+ hasOpts = true;
+ v = arguments[ nargs - 2 ];
+ if ( !isndarrayLike( v ) ) {
+ throw new TypeError( format( 'invalid argument. Values argument must be an ndarray. Value: `%s`.', v ) );
+ }
+ hasValues = true;
+ } else if ( nargs === 3 ) { // Case: splice( x, s, ???)
+ options = arguments[ nargs - 1 ];
+ hasOpts = true;
+ if ( !isPlainObject( options ) ) {
+ v = options;
+ if ( !isndarrayLike( v ) ) {
+ throw new TypeError( format( 'invalid argument. Values argument must be an ndarray. Value: `%s`.', v ) );
+ }
+ hasOpts = false;
+ hasValues = true;
+ }
+ }
+
+ // Validate options:
+ if ( hasOpts ) {
+ if ( hasOwnProp( options, 'dim') ) {
+ opts.dim = options.dim;
+ if ( !isNegativeInteger( opts.dim ) ) {
+ throw new TypeError( format( 'invalid option. `%s` option must be a negative integer. Option: `%s`.', 'dim', opts.dim ) );
+ }
+ }
+ }
+
+ spdim = normalizeIndex( opts.dim, N-1 );
+ if ( spdim === -1 ) {
+ throw new RangeError( format( 'invalid argument. Dimension index exceeds the number of dimensions. Number of dimensions: %d. Value: `%d`.', N, spdim ) );
+ }
+ // Define a list of MultiSlice constructor arguments:
+ args = nulls( N );
+ args[ spdim ] = s;
+ ms = args2multislice( args );
+
+ // Validate slices:
+ sh = getShape( x );
+ S = normalizeMultiSlice( ms, sh, true );
+ if ( S.code ) {
+ throw new RangeError( format( 'invalid argument. Slice exceeds array bounds. Array shape: (%s).', sh.join( ',' ) ) );
+ }
+ slices = S.data;
+ for ( i = 0; i < slices.length; i++ ) {
+ if ( slices[ i ].step !== 1 ) {
+ throw new RangeError( format( 'invalid argument. Slice arguments must have an index increment of `1` . Value: `%d`.', slices[ i ].step ) );
+ }
+ }
+
+ // Create input array views:
+ views = [];
+ st = slices[ spdim ].start;
+ ed = slices[ spdim ].stop;
+ lvf = false;
+ rvf = false;
+ if ( st > 0 ) {
+ slices[ spdim ] = new Slice( 0, st, 1 );
+ views.push( slice( x, slices, {
+ 'strict': true
+ }));
+ lvf = true;
+ }
+ if ( ed < sh[ spdim ] ) {
+ slices[ spdim ] = new Slice( ed, sh[ spdim ], 1 );
+ views.push( slice( x, slices, {
+ 'strict': true
+ }));
+ rvf = true;
+ }
+ if ( !lvf && !rvf ) {
+ views.push( slice( x, slices, {
+ 'strict': true
+ }));
+ }
+
+ if ( hasValues ) {
+ if ( ndims( v ) !== N ) {
+ v = maybeBroadcastArray( v, getShape( views[ 0 ] ) );
+ }
+ if ( lvf && rvf ) {
+ return base( [ views[ 0 ], v, views[ 1 ] ], opts );
+ }
+ if ( lvf ) {
+ return base( [ views[ 0 ], v ], opts );
+ }
+ return base( [ v, views[ 0 ] ], opts );
+ }
+ return base( views, opts );
+}
+
+
+// EXPORTS //
+
+module.exports = splice;
diff --git a/lib/node_modules/@stdlib/ndarray/splice/package.json b/lib/node_modules/@stdlib/ndarray/splice/package.json
new file mode 100644
index 000000000000..71ccb19186e0
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/package.json
@@ -0,0 +1,64 @@
+{
+ "name": "@stdlib/ndarray/splice",
+ "version": "0.0.0",
+ "description": "Return an ndarray where elements of an input ndarray are replaced or removed along a specific 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",
+ "data",
+ "structure",
+ "vector",
+ "ndarray",
+ "matrix",
+ "splice",
+ "replace",
+ "remove"
+ ]
+}
diff --git a/lib/node_modules/@stdlib/ndarray/splice/test/test.js b/lib/node_modules/@stdlib/ndarray/splice/test/test.js
new file mode 100644
index 000000000000..837fa1a1a3b4
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/test/test.js
@@ -0,0 +1,1018 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 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.
+*/
+
+/* eslint-disable object-curly-newline */
+
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var Slice = require( '@stdlib/slice/ctor' );
+var array = require( '@stdlib/ndarray/array' );
+var zeros = require( '@stdlib/ndarray/zeros' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var splice = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof splice, '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() {
+ splice( value, 0 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a first argument which is not an ndarray (values)', function test( t ) {
+ var values;
+ var y;
+ var i;
+
+ values = [
+ '5',
+ 5,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ {},
+ function noop() {}
+ ];
+ y = zeros( [ 1, 2 ] );
+
+ 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() {
+ splice( value, 0, y );
+ };
+ }
+});
+
+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() {
+ splice( value, 0, {} );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a first argument which is not an ndarray (values, options)', function test( t ) {
+ var values;
+ var y;
+ var i;
+
+ values = [
+ '5',
+ 5,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ {},
+ function noop() {}
+ ];
+ y = zeros( [ 1, 2 ] );
+
+ 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() {
+ splice( value, 0, y, {} );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is not a valid slice argument', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ values = [
+ '5',
+ 3.14,
+ NaN,
+ true,
+ false,
+ [],
+ {},
+ function noop() {}
+ ];
+ x = zeros( [ 2, 2 ] );
+
+ 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() {
+ splice( x, value );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is not a valid slice argument (values)', function test( t ) {
+ var values;
+ var x;
+ var y;
+ var i;
+
+ values = [
+ '5',
+ 3.14,
+ NaN,
+ true,
+ false,
+ [],
+ {},
+ function noop() {}
+ ];
+ x = zeros( [ 2, 2 ] );
+ y = zeros( [ 1, 2 ] );
+
+ 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() {
+ splice( x, value, y );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is not a valid slice argument (options)', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ values = [
+ '5',
+ 3.14,
+ NaN,
+ true,
+ false,
+ [],
+ {},
+ function noop() {}
+ ];
+ x = zeros( [ 2, 2 ] );
+
+ 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() {
+ splice( x, value, {} );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is not a valid slice argument (values, options)', function test( t ) {
+ var values;
+ var x;
+ var y;
+ var i;
+
+ values = [
+ '5',
+ 3.14,
+ NaN,
+ true,
+ false,
+ [],
+ {},
+ function noop() {}
+ ];
+ x = zeros( [ 2, 2 ] );
+ y = zeros( [ 1, 2 ] );
+
+ 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() {
+ splice( x, value, y, {} );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a values argument which is not an ndarray', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ values = [
+ '5',
+ 5,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ function noop() {}
+ ];
+ x = zeros( [ 2, 2 ] );
+
+ 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() {
+ splice( x, 0, value );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a values argument which is not an ndarray (options)', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ values = [
+ '5',
+ 5,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ function noop() {}
+ ];
+ x = zeros( [ 2, 2 ] );
+
+ 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() {
+ splice( x, 0, value, {} );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided an options argument which is not an object', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ values = [
+ '5',
+ 5,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ function noop() {}
+ ];
+ x = zeros( [ 2, 2 ] );
+
+ 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() {
+ splice( x, 0, value );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided an options argument which is not an object (values)', function test( t ) {
+ var values;
+ var x;
+ var y;
+ var i;
+
+ values = [
+ '5',
+ 5,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ [],
+ function noop() {}
+ ];
+ x = zeros( [ 2, 2 ] );
+ y = zeros( [ 1, 2 ] );
+
+ 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() {
+ splice( x, 0, y, value );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a `dim` option which is not a negative integer', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ values = [
+ '5',
+ 5.5,
+ 0,
+ 1,
+ 2,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ {},
+ [],
+ function noop() {}
+ ];
+ x = zeros( [ 2, 2 ] );
+
+ 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() {
+ splice( x, 0, {
+ 'dim': value
+ });
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a `dim` option which is not a negative integer (values)', function test( t ) {
+ var values;
+ var x;
+ var y;
+ var i;
+
+ values = [
+ '5',
+ 5.5,
+ 0,
+ 1,
+ 2,
+ NaN,
+ true,
+ false,
+ null,
+ void 0,
+ {},
+ [],
+ function noop() {}
+ ];
+ x = zeros( [ 2, 2 ] );
+ y = zeros( [ 1, 2 ] );
+
+ 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() {
+ splice( x, 0, y, {
+ 'dim': value
+ });
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a `dim` option which exceeds the number of dimensions of the input ndarray', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ values = [
+ { 'dim': -5 },
+ { 'dim': -8 },
+ { 'dim': -10 },
+ { 'dim': -5 }
+ ];
+ x = zeros( [ 2, 2 ] );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValues( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValues( value ) {
+ return function badValues() {
+ splice( x, 0, value );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a zero-dimensional array', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ zeros( [] )
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), TypeError, 'throws an error' );
+ }
+ t.end();
+
+ function badValue( x ) {
+ return function badValue() {
+ splice( x, 0 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a zero-dimensional array (values)', function test( t ) {
+ var values;
+ var y;
+ var i;
+
+ values = [
+ zeros( [] )
+ ];
+ y = zeros( [] );
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), TypeError, 'throws an error' );
+ }
+ t.end();
+
+ function badValue( x ) {
+ return function badValue() {
+ splice( x, 0, y );
+ };
+ }
+});
+
+tape( 'the function throws an error when a slice exceeds array bounds', function test( t ) {
+ var values;
+ var slices;
+ var i;
+
+ values = [
+ zeros( [ 1 ] ),
+ zeros( [ 1, 1 ] ),
+ zeros( [ 1, 1, 1 ] ),
+ zeros( [ 1, 1, 1, 1 ] )
+ ];
+
+ slices = [
+ new Slice( 5, 20, 1 ),
+ 10,
+ new Slice( 7, 8, 1 ),
+ 20
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValues( values[ i ], slices[ i ] ), RangeError, 'throws an error when provided ' + slices[ i ].toString() );
+ }
+ t.end();
+
+ function badValues( x, s ) {
+ return function badValues() {
+ splice( x, s );
+ };
+ }
+});
+
+tape( 'the function throws an error when a slice exceeds array bounds (values)', function test( t ) {
+ var values;
+ var slices;
+ var y;
+ var i;
+
+ values = [
+ zeros( [ 1 ] ),
+ zeros( [ 1, 1 ] ),
+ zeros( [ 1, 1, 1 ] ),
+ zeros( [ 1, 1, 1, 1 ] )
+ ];
+ slices = [
+ new Slice( 5, 20, 1 ),
+ 10,
+ new Slice( 7, 8, 1 ),
+ 20
+ ];
+ y = zeros( [ 5, 5 ] );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValues( values[ i ], slices[ i ] ), RangeError, 'throws an error when provided ' + slices[ i ].toString() );
+ }
+ t.end();
+
+ function badValues( x, s ) {
+ return function badValues() {
+ splice( x, s, y );
+ };
+ }
+});
+
+tape( 'the function throws an error when a slice exceeds array bounds (options)', function test( t ) {
+ var values;
+ var slices;
+ var i;
+
+ values = [
+ zeros( [ 1 ] ),
+ zeros( [ 1, 1 ] ),
+ zeros( [ 1, 1, 1 ] ),
+ zeros( [ 1, 1, 1, 1 ] )
+ ];
+
+ slices = [
+ new Slice( 5, 20, 1 ),
+ 10,
+ new Slice( 7, 8, 1 ),
+ 20
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValues( values[ i ], slices[ i ] ), RangeError, 'throws an error when provided ' + slices[ i ].toString() );
+ }
+ t.end();
+
+ function badValues( x, s ) {
+ return function badValues() {
+ splice( x, s, {} );
+ };
+ }
+});
+
+tape( 'the function throws an error when a slice exceeds array bounds (values, options)', function test( t ) {
+ var values;
+ var slices;
+ var y;
+ var i;
+
+ values = [
+ zeros( [ 1 ] ),
+ zeros( [ 1, 1 ] ),
+ zeros( [ 1, 1, 1 ] ),
+ zeros( [ 1, 1, 1, 1 ] )
+ ];
+ slices = [
+ new Slice( 5, 20, 1 ),
+ 10,
+ new Slice( 7, 8, 1 ),
+ 20
+ ];
+ y = zeros( [ 5, 5 ] );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValues( values[ i ], slices[ i ] ), RangeError, 'throws an error when provided ' + slices[ i ].toString() );
+ }
+ t.end();
+
+ function badValues( x, s ) {
+ return function badValues() {
+ splice( x, s, y, {} );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a slice argument unsupported index increment', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ values = [
+ new Slice( 0, 1, 2 ),
+ new Slice( 1, 2, -1 ),
+ new Slice( 2, null, 3 )
+ ];
+ x = zeros( [ 2, 2, 2 ] );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValues( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ].toString() );
+ }
+ t.end();
+
+ function badValues( value ) {
+ return function badValues() {
+ splice( x, value );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a slice argument unsupported index increment (values)', function test( t ) {
+ var values;
+ var x;
+ var y;
+ var i;
+
+ values = [
+ new Slice( 0, 1, 2 ),
+ new Slice( 1, 2, -1 ),
+ new Slice( 2, null, 3 )
+ ];
+ x = zeros( [ 2, 2, 2 ] );
+ y = zeros( [ 1, 2 ] );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValues( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ].toString() );
+ }
+ t.end();
+
+ function badValues( value ) {
+ return function badValues() {
+ splice( x, value, y );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a slice argument unsupported index increment (options)', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ values = [
+ new Slice( 0, 1, 2 ),
+ new Slice( 1, 2, -1 ),
+ new Slice( 2, null, 3 )
+ ];
+ x = zeros( [ 2, 2, 2 ] );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValues( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ].toString() );
+ }
+ t.end();
+
+ function badValues( value ) {
+ return function badValues() {
+ splice( x, value, {} );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a slice argument unsupported index increment (values, options)', function test( t ) {
+ var values;
+ var x;
+ var y;
+ var i;
+
+ values = [
+ new Slice( 0, 1, 2 ),
+ new Slice( 1, 2, -1 ),
+ new Slice( 2, null, 3 )
+ ];
+ x = zeros( [ 2, 2, 2 ] );
+ y = zeros( [ 1, 2 ] );
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValues( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ].toString() );
+ }
+ t.end();
+
+ function badValues( value ) {
+ return function badValues() {
+ splice( x, value, y, {} );
+ };
+ }
+});
+
+tape( 'the function returns an ndarray where elements of an input ndarray are replaced or removed along a specific dimension (1-dimensional)', function test( t ) {
+ var expected;
+ var out;
+ var x;
+ var y;
+
+ x = array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
+
+ out = splice( x, new Slice( 1, 4, 1 ) );
+
+ expected = [ 1.0, 5.0 ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 3 ] );
+
+ out = splice( x, new Slice( 1, 4, 1 ), y );
+
+ expected = [ 1.0, 0.0, 0.0, 0.0, 5.0 ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns an ndarray where elements of an input ndarray are replaced or removed along a specific dimension (2-dimensional)', function test( t ) {
+ var expected;
+ var out;
+ var x;
+ var y;
+
+ x = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ) );
+
+ expected = [ [ 2.0 ], [ 4.0 ], [ 6.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ out = splice( x, new Slice( 1, 2, 1 ) );
+
+ expected = [ [ 1.0 ], [ 3.0 ], [ 5.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 3, 1 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), y );
+
+ expected = [ [ 0.0, 2.0 ], [ 0.0, 4.0 ], [ 0.0, 6.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 3, 1 ] );
+
+ out = splice( x, new Slice( 1, 2, 1 ), y );
+
+ expected = [ [ 1.0, 0.0 ], [ 3.0, 0.0 ], [ 5.0, 0.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ out = splice( x, new Slice( 0, 1, 1 ), {
+ 'dim': -2
+ });
+
+ expected = [ [ 3.0, 4.0 ], [ 5.0, 6.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ out = splice( x, new Slice( 1, 2, 1 ), {
+ 'dim': -2
+ });
+
+ expected = [ [ 1.0, 2.0 ], [ 5.0, 6.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ out = splice( x, new Slice( 2, null, 1 ), {
+ 'dim': -2
+ });
+
+ expected = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 1, 2 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), y, {
+ 'dim': -2
+ });
+
+ expected = [ [ 0.0, 0.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 1, 2 ] );
+
+ out = splice( x, new Slice( 1, 2, 1 ), y, {
+ 'dim': -2
+ });
+
+ expected = [ [ 1.0, 2.0 ], [ 0.0, 0.0 ], [ 5.0, 6.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 1, 2 ] );
+
+ out = splice( x, new Slice( 2, null, 1 ), y, {
+ 'dim': -2
+ });
+
+ expected = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 0.0, 0.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns an ndarray where elements of an input ndarray are replaced or removed along a specific dimension (3-dimensional)', function test( t ) {
+ var expected;
+ var out;
+ var x;
+ var y;
+
+ x = array( [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 5.0, 6.0 ], [ 7.0, 8.0 ] ] ] ); // eslint-disable-line max-len
+
+ out = splice( x, new Slice( 0, 1, 1 ) );
+
+ expected = [ [ [ 2.0 ], [ 4.0 ] ], [ [ 6.0 ], [ 8.0 ] ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ out = splice( x, new Slice( 1, 2, 1 ) );
+
+ expected = [ [ [ 1.0 ], [ 3.0 ] ], [ [ 5.0 ], [ 7.0 ] ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 2, 2, 1 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), y );
+
+ expected = [ [ [ 0.0, 2.0 ], [ 0.0, 4.0 ] ], [ [ 0.0, 6.0 ], [ 0.0, 8.0 ] ] ]; // eslint-disable-line max-len
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 2, 2, 1 ] );
+
+ out = splice( x, new Slice( 1, 2, 1 ), y );
+
+ expected = [ [ [ 1.0, 0.0 ], [ 3.0, 0.0 ] ], [ [ 5.0, 0.0 ], [ 7.0, 0.0 ]] ]; // eslint-disable-line max-len
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ out = splice( x, new Slice( 0, 1, 1 ), {
+ 'dim': -2
+ });
+
+ expected = [ [ [ 3.0, 4.0 ] ], [ [ 7.0, 8.0 ] ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ out = splice( x, new Slice( 1, 2, 1 ), {
+ 'dim': -2
+ });
+
+ expected = [ [ [ 1.0, 2.0 ] ], [ [ 5.0, 6.0 ] ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 2, 1, 2 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), y, {
+ 'dim': -2
+ });
+
+ expected = [ [ [ 0.0, 0.0 ], [ 3.0, 4.0 ] ], [ [ 0.0, 0.0 ], [ 7.0, 8.0 ] ] ]; // eslint-disable-line max-len
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 2, 1, 2 ] );
+
+ out = splice( x, new Slice( 1, 2, 1 ), y, {
+ 'dim': -2
+ });
+
+ expected = [ [ [ 1.0, 2.0 ], [ 0.0, 0.0 ] ], [ [ 5.0, 6.0 ], [ 0.0, 0.0 ] ] ]; // eslint-disable-line max-len
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ out = splice( x, new Slice( 0, 1, 1 ), {
+ 'dim': -3
+ });
+
+ expected = [ [ [ 5.0, 6.0 ], [ 7.0, 8.0 ] ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ out = splice( x, new Slice( 1, 2, 1 ), {
+ 'dim': -3
+ });
+
+ expected = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 1, 2, 2 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), y, {
+ 'dim': -3
+ });
+
+ expected = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ], [ [ 5.0, 6.0 ], [ 7.0, 8.0 ] ] ]; // eslint-disable-line max-len
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 1, 2, 2 ] );
+
+ out = splice( x, new Slice( 1, 2, 1 ), y, {
+ 'dim': -3
+ });
+
+ expected = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ]; // eslint-disable-line max-len
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ t.end();
+});