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..e68946dc0687
--- /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, slices\[, 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].
+- **slices**: a [`Slice`][@stdlib/slice/ctor] instance, `null`, `undefined`, an integer, or an array of such values. 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] or an array of [`ndarrays`][@stdlib/ndarray/ctor] containing the elements to insert. The provided [`ndarrays`][@stdlib/ndarray/ctor] 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 an 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( [ 1, 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..8608b5d38b8b
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/docs/repl.txt
@@ -0,0 +1,47 @@
+
+{{alias}}( x, slices[, 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.
+
+ slices: Slice|integer|null|undefined|ArrayLikeObject
+ Slice object, `null`, `undefined`, an integer or an array of such
+ values. 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|ArrayLikeObject (optional)
+ An ndarray or an array of ndarrays containing the elements to insert.
+ The provided ndarrays must be broadcast-compatible with the slice
+ region.
+
+ options: Object (optional)
+ Options.
+
+ options.dim: integer (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..9e169c657791
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/docs/types/index.d.ts
@@ -0,0 +1,181 @@
+/*
+* @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 arguments
+* @param values - an ndarray or an array of ndarrays 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: Array, values?: T, options?: Options ): T;
+
+/**
+* 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 arguments
+* @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 s = new Slice( 1, 2, 1 );
+* // returns
+*
+* var out = splice( x, [ s ], {
+* 'dim': -2
+* });
+* // returns [ [ 1.0, 2.0 ], [ 5.0, 6.0 ] ]
+*/
+declare function splice( x: T, s: Array, options?: Options ): T;
+
+/**
+* Returns an ndarray where the elements of an input ndarray are replaced or removed along a specific dimension.
+*
+* @param x - input array
+* @param args - slice and options arguments
+* @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 s = new Slice( 1, 2, 1 );
+* // returns
+*
+* var out = splice( x, s, {
+* 'dim': -2
+* });
+* // returns [ [ 1.0, 2.0 ], [ 5.0, 6.0 ] ]
+*/
+declare function splice( x: T, ...args: Array ): T;
+
+/**
+* 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 arguments
+* @param values - an ndarray or an array of ndarrays 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: Array, values: ndarray | Array, options?: Options ): T; // FIXME: this can result in incorrect output type inference when type promotion occurs (e.g., input `float32` and values is a `float64`, the result is `float64`, not `float32`)
+
+/**
+* Returns an ndarray where the elements of an input ndarray are replaced or removed along a specific dimension.
+*
+* @param x - input array
+* @param args - slice, values and options arguments
+* @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, ...args: Array | ndarray | Options> ): T; // FIXME: this can result in incorrect output type inference when type promotion occurs (e.g., input `float32` and values is a `float64`, the result is `float64`, not `float32`)
+
+
+// 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..e9dc94373d68
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/docs/types/test.ts
@@ -0,0 +1,207 @@
+/*
+* @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 or an array of slice arguments...
+{
+ 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, ( x: number ): number => x ); // $ExpectError
+
+ splice( x, '5', {} ); // $ExpectError
+ splice( x, false, {} ); // $ExpectError
+ splice( x, true, {} ); // $ExpectError
+ splice( x, [ '5' ], {} ); // $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, ( 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, ( x: number ): number => x, y, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a values argument which is not an ndarray or an array of ndarrays...
+{
+ const x = empty( 'float64', [ 2, 2 ], 'row-major' );
+ const s = new Slice( null );
+
+ splice( x, s, '5' ); // $ExpectError
+ splice( x, s, true ); // $ExpectError
+ splice( x, s, false ); // $ExpectError
+ splice( x, s, [ '5' ] ); // $ExpectError
+ splice( x, s, ( x: number ): number => x ); // $ExpectError
+
+ splice( x, s, '5', {} ); // $ExpectError
+ splice( x, s, true, {} ); // $ExpectError
+ splice( x, s, false, {} ); // $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, true ); // $ExpectError
+ splice( x, s, y, false ); // $ExpectError
+ splice( x, s, y, [ '5' ] ); // $ExpectError
+ splice( x, s, y, ( x: number ): number => x ); // $ExpectError
+
+ splice( x, s, '5' ); // $ExpectError
+ splice( x, s, true ); // $ExpectError
+ splice( x, s, false ); // $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
+}
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..e906b1539e15
--- /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( [ 1, 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..f7ebb885b7d9
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/lib/main.js
@@ -0,0 +1,339 @@
+/**
+* @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 max-lines-per-function, max-statements */
+
+'use strict';
+
+// MODULES //
+
+var isArray = require( '@stdlib/assert/is-array' );
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var isInteger = require( '@stdlib/assert/is-integer' );
+var isPlainObject = require( '@stdlib/assert/is-plain-object' );
+var hasOwnProp = require( '@stdlib/assert/has-own-property' );
+var zeroTo = require( '@stdlib/array/zero-to' );
+var Slice = require( '@stdlib/slice/ctor' );
+var ndims = require( '@stdlib/ndarray/ndims' );
+var normalizeIndex = require( '@stdlib/ndarray/base/normalize-index' );
+var format = require( '@stdlib/string/format' );
+var concat = require( '@stdlib/ndarray/concat' );
+var args2multislice = require( '@stdlib/slice/base/args2multislice' );
+var slice = require( '@stdlib/ndarray/base/slice' );
+var getShape = require( '@stdlib/ndarray/shape' );
+var getDType = require( '@stdlib/ndarray/dtype' );
+var getOrder = require( '@stdlib/ndarray/order' );
+var nulls = require( '@stdlib/array/base/nulls' );
+var empty = require( '@stdlib/ndarray/empty' );
+var normalizeSlices = require( './normalizeslices.js' );
+
+
+// FUNCTIONS //
+
+/**
+* Returns a function that compares slice indices by their `start` value.
+*
+* @private
+* @param {Array} slices - an array of slice objects.
+* @returns {Function} - a function that compares slice indices by their `start` value.
+*/
+function sliceOrder( slices ) {
+ return fcn;
+
+ /**
+ * Compares two slice indices based on their `start` value.
+ *
+ * @private
+ * @param {number} i - index of the first slice
+ * @param {number} j - index of the second slice
+ * @returns {number} sort order
+ */
+ function fcn( i, j ) {
+ return slices[ i ].start - slices[ j ].start;
+ }
+}
+
+
+// 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 {...*} s - slice arguments
+* @param {(ndarray|Array)} values - an ndarray or an array of ndarrays 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 or an array of ndarrays
+* @throws {RangeError} number of slices and values ndarray must be equal
+* @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 ) {
+ var sortedSlices;
+ var hasValues;
+ var options;
+ var hasOpts;
+ var indices;
+ var prevEnd;
+ var slices;
+ var pieces;
+ var nargs;
+ var spdim;
+ var opts;
+ var args;
+ var sh;
+ var ms;
+ var v1;
+ var s1;
+ var v;
+ var N;
+ 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 );
+ sh = getShape( 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 ( isPlainObject( arguments[ nargs - 1 ] ) ) {
+ hasOpts = true;
+ options = arguments[ nargs - 1 ];
+ if ( nargs > 4 ) {
+ v = arguments[ nargs - 2 ];
+ if ( isArray( v ) ) { // Case: splice( x, s1, s2, [ v1, v2 ], options )
+ for ( i = 0; i < v.length; i++ ) {
+ if ( !isndarrayLike( v[ i ] ) ) {
+ throw new TypeError( format( 'invalid argument. Values argument must be an array of ndarrays. Value: `%s`.', v ) );
+ }
+ }
+ hasValues = true;
+ slices = [];
+ for ( i = 1; i < arguments.length-2; i++ ) {
+ slices.push( arguments[ i ] );
+ }
+ } else { // Case: splice( x, s1, s2, s3, options )
+ slices = [];
+ for ( i = 1; i <= arguments.length - 2; i++ ) {
+ slices.push( arguments[ i ] );
+ }
+ }
+ } else if ( nargs === 4 ) {
+ v = arguments[ nargs - 2 ];
+ if ( isndarrayLike( v ) ) { // Case: splice( x, s1, v1, options ) or splice( x, [ s1 ], v1, options )
+ v = [ v ];
+ hasValues = true;
+ slices = arguments[ nargs - 3 ];
+ if ( !isArray( slices ) ) {
+ slices = [ arguments[ nargs - 3 ] ];
+ }
+ } else if ( isArray( v ) ) { // Case: splice( x, s1, [ v1 ], options ) or splice( x, [ s1 ], [ v1 ], options )
+ for ( i = 0; i < v.length; i++ ) {
+ if ( !isndarrayLike( v[ i ] ) ) {
+ throw new TypeError( format( 'invalid argument. Values argument must be an array of ndarrays. Value: `%s`.', v ) );
+ }
+ }
+ hasValues = true;
+ slices = arguments[ nargs - 3 ];
+ if ( !isArray( slices ) ) {
+ slices = [ arguments[ nargs - 3 ] ];
+ }
+ } else { // Case: splice( x, s1, s2, options )
+ slices = [];
+ for ( i = 1; i <= arguments.length - 2; i++ ) {
+ slices.push( arguments[ i ] );
+ }
+ }
+ } else if ( nargs <= 3 ) { // Case: splice( x, ???, options )
+ slices = arguments[ nargs - 2 ];
+ if ( !isArray( slices ) ) {
+ slices = [ slices ];
+ }
+ }
+ } else {
+ hasOpts = false;
+ if ( nargs >= 3 ) {
+ v = arguments[ nargs - 1 ];
+ if ( isndarrayLike( v ) ) { // Case: splice( x, s1, v1 ) or splice( x, [ s1 ], v1 )
+ v = [ v ];
+ hasValues = true;
+ if ( isArray( arguments[ 1 ] ) ) {
+ slices = arguments[ 1 ];
+ } else {
+ slices = [];
+ for ( i = 1; i < arguments.length-1; i++ ) {
+ slices.push( arguments[ i ] );
+ }
+ }
+ } else if ( isArray( v ) ) { // Case: splice( x, s1, s2, s3, [ v1, v2, v3 ] )
+ for ( i = 0; i < v.length; i++ ) {
+ if ( !isndarrayLike( v[ i ] ) ) {
+ throw new TypeError( format( 'invalid argument. Values argument must be an array of ndarrays. Value: `%s`.', v ) );
+ }
+ }
+ hasValues = true;
+ if ( isArray( arguments[ 1 ] ) ) {
+ slices = arguments[ 1 ];
+ } else {
+ slices = [];
+ for ( i = 1; i < arguments.length-1; i++ ) {
+ slices.push( arguments[ i ] );
+ }
+ }
+ } else { // Case: splice( x, s1, s2, s3 )
+ slices = [];
+ for ( i = 1; i < arguments.length; i++ ) {
+ slices.push( arguments[ i ] );
+ }
+ }
+ } else { // Case: splice( x, s1 ) or splice( x, [ s1 ] )
+ slices = arguments[ nargs - 1 ];
+ if ( !isArray( slices ) ) {
+ slices = [ arguments[ nargs - 1 ] ];
+ }
+ }
+ }
+
+ if ( hasValues && slices.length !== v.length ) {
+ throw new RangeError( 'invalid argument. Number of slices must be equal to the number of values ndarray.' );
+ }
+
+ // Validate options:
+ if ( hasOpts ) {
+ if ( hasOwnProp( options, 'dim') ) {
+ opts.dim = options.dim;
+ if ( !isInteger( opts.dim ) ) {
+ throw new TypeError( format( 'invalid option. `%s` option must be an integer. Option: `%d`.', 'dim', opts.dim ) );
+ }
+ }
+ }
+
+ // Normalize slices:
+ 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 ) );
+ }
+ slices = normalizeSlices( x, slices, spdim );
+ 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 ) );
+ }
+ }
+
+ // Sort the normalized slices:
+ if ( slices.length > 1 ) {
+ indices = zeroTo( slices.length );
+ indices.sort( sliceOrder( slices ) );
+ sortedSlices = [];
+ for ( i = 0; i < indices.length; i++ ) {
+ sortedSlices.push( slices[ indices[ i ] ] );
+ }
+ if ( hasValues ) {
+ v1 = [];
+ for ( i = 0; i < indices.length; i++ ) {
+ v1.push( v[ indices[ i ] ] );
+ }
+ }
+ } else {
+ sortedSlices = slices;
+ if ( hasValues ) {
+ v1 = v;
+ }
+ }
+
+ // Validate slice regions:
+ for ( i = 1; i < sortedSlices.length; i++ ) {
+ if (
+ slices[ i ].start < slices[ i - 1 ].stop &&
+ slices[ i ].stop > slices[ i - 1 ].start
+ ) {
+ throw new RangeError( 'invalid argument. Slice regions must not overlap.' );
+ }
+ }
+
+ pieces = [];
+ prevEnd = 0;
+ for ( i = 0; i < sortedSlices.length; i++ ) {
+ s1 = sortedSlices[ i ];
+ if ( s1.start > prevEnd ) {
+ args = nulls( sh.length );
+ args[ spdim ] = new Slice( prevEnd, s1.start, 1 );
+ ms = args2multislice( args );
+ pieces.push( slice( x, ms, true, false ) );
+ }
+ if ( hasValues && v1[ i ] ) {
+ pieces.push( v1[ i ] );
+ }
+ prevEnd = s1.stop;
+ }
+ if ( prevEnd < sh[ spdim ] ) {
+ args = nulls( sh.length );
+ args[ spdim ] = new Slice( prevEnd, sh[ spdim ], 1 );
+ ms = args2multislice( args );
+ pieces.push( slice( x, ms, true, false ));
+ }
+ if ( pieces.length === 0 ) {
+ return empty( [], {
+ 'dtype': getDType( x ),
+ 'order': getOrder( x )
+ });
+ }
+ return concat( pieces, opts );
+}
+
+
+// EXPORTS //
+
+module.exports = splice;
diff --git a/lib/node_modules/@stdlib/ndarray/splice/lib/normalizeslices.js b/lib/node_modules/@stdlib/ndarray/splice/lib/normalizeslices.js
new file mode 100644
index 000000000000..7ee343679935
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/lib/normalizeslices.js
@@ -0,0 +1,69 @@
+/**
+* @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 args2multislice = require( '@stdlib/slice/base/args2multislice' );
+var normalizeMultiSlice = require( '@stdlib/slice/base/normalize-multi-slice' );
+var getShape = require( '@stdlib/ndarray/shape' );
+var nulls = require( '@stdlib/array/base/nulls' );
+var join = require( '@stdlib/array/base/join' );
+var format = require( '@stdlib/string/format' );
+
+
+// MAIN //
+
+/**
+* Returns normalized slice regions for a list of slices along a specified dimension.
+*
+* @private
+* @param {ndarray} x - input array
+* @param {Array<(Slice|integer|null|void)>} sliceList - list of slices
+* @param {integer} dim - dimension along which to normalize slices
+* @throws {RangeError} slice exceeds array bounds
+* @returns {Array} array of normalized slices
+*/
+function normalizeSlices( x, sliceList, dim ) {
+ var args;
+ var out;
+ var sh;
+ var ms;
+ var i;
+ var S;
+
+ sh = getShape( x );
+ out = [];
+ for ( i = 0; i < sliceList.length; i++ ) {
+ args = nulls( sh.length );
+ args[ dim ] = sliceList[ i ];
+ ms = args2multislice( args );
+ S = normalizeMultiSlice( ms, sh, true );
+ if ( S.code ) {
+ throw new RangeError( format( 'invalid argument. Slice exceeds array bounds. Array shape: (%s).', join( sh, ',' ) ) );
+ }
+ out.push( S.data[ dim ] );
+ }
+ return out;
+}
+
+
+// EXPORTS //
+
+module.exports = normalizeSlices;
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..5424ac61f567
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/splice/test/test.js
@@ -0,0 +1,1389 @@
+/**
+* @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,
+ [ '5' ],
+ {},
+ 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,
+ [ '5' ],
+ {},
+ 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,
+ [ '5' ],
+ {},
+ 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,
+ [ '5' ],
+ {},
+ 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 ] ), Error, '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 ] ), Error, '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 ] ), Error, '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 ] ), Error, '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 an integer', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ values = [
+ '5',
+ 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 ] ), Error, '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 an integer (values)', function test( t ) {
+ var values;
+ var x;
+ var y;
+ var i;
+
+ values = [
+ '5',
+ 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 ] ), Error, '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' );
+
+ out = splice( x, new Slice( 1, 2, 1 ), new Slice( 3, 4, 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 ] );
+
+ 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' );
+
+ y = zeros( [ 1 ] );
+
+ out = splice( x, new Slice( 1, 2, 1 ), new Slice( 3, 4, 1 ), [ y, y ] );
+
+ expected = [ 1.0, 0.0, 3.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 ], [ 7.0, 8.0, 9.0 ] ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ) );
+
+ expected = [ [ 2.0, 3.0 ], [ 5.0, 6.0 ], [ 8.0, 9.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 ], [ 4.0, 6.0 ], [ 7.0, 9.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 ), new Slice( 2, 3, 1 ) );
+
+ expected = [ [ 2.0 ], [ 5.0 ], [ 8.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, 3.0 ], [ 0.0, 5.0, 6.0 ], [ 0.0, 8.0, 9.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 ], [ 4.0, 0.0, 6.0 ], [ 7.0, 0.0, 9.0 ] ];
+
+ y = zeros( [ 3, 1 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), new Slice( 2, 3, 1 ), [ y, y ] );
+
+ expected = [ [ 0.0, 2.0, 0.0 ], [ 0.0, 5.0, 0.0 ], [ 0.0, 8.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 = [ [ 4.0, 5.0, 6.0 ], [ 7.0, 8.0, 9.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, 3.0 ], [ 7.0, 8.0, 9.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, 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( 0, 1, 1 ), new Slice( 2, 3, 1 ), {
+ 'dim': -2
+ });
+
+ expected = [ [ 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, 3 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), y, {
+ 'dim': -2
+ });
+
+ expected = [ [ 0.0, 0.0, 0.0 ], [ 4.0, 5.0, 6.0 ], [ 7.0, 8.0, 9.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 1, 3 ] );
+
+ out = splice( x, new Slice( 1, 2, 1 ), y, {
+ 'dim': -2
+ });
+
+ expected = [ [ 1.0, 2.0, 3.0 ], [ 0.0, 0.0, 0.0 ], [ 7.0, 8.0, 9.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 1, 3 ] );
+
+ out = splice( x, new Slice( 2, null, 1 ), y, {
+ 'dim': -2
+ });
+
+ expected = [ [ 1.0, 2.0, 3.0 ], [ 4.0, 5.0, 6.0 ], [ 0.0, 0.0, 0.0 ] ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 1, 3 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), new Slice( 2, null, 1 ), [ y, y ], {
+ 'dim': -2
+ });
+
+ expected = [ [ 0.0, 0.0, 0.0 ], [ 4.0, 5.0, 6.0 ], [ 0.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, 9.0 ]
+ ],
+ [
+ [ 10.0, 11.0, 12.0 ],
+ [ 13.0, 14.0, 15.0 ],
+ [ 16.0, 17.0, 18.0 ]
+ ],
+ [
+ [ 19.0, 20.0, 21.0 ],
+ [ 22.0, 23.0, 24.0 ],
+ [ 25.0, 26.0, 27.0 ]
+ ]
+ ]);
+
+ out = splice( x, new Slice( 0, 1, 1 ) );
+
+ expected = [
+ [
+ [ 2.0, 3.0 ],
+ [ 5.0, 6.0 ],
+ [ 8.0, 9.0 ]
+ ],
+ [
+ [ 11.0, 12.0 ],
+ [ 14.0, 15.0 ],
+ [ 17.0, 18.0 ]
+ ],
+ [
+ [ 20.0, 21.0 ],
+ [ 23.0, 24.0 ],
+ [ 26.0, 27.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 ],
+ [ 4.0, 6.0 ],
+ [ 7.0, 9.0 ]
+ ],
+ [
+ [ 10.0, 12.0 ],
+ [ 13.0, 15.0 ],
+ [ 16.0, 18.0 ]
+ ],
+ [
+ [ 19.0, 21.0 ],
+ [ 22.0, 24.0 ],
+ [ 25.0, 27.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 ), new Slice( 2, 3, 1 ) );
+
+ expected = [
+ [
+ [ 2.0 ],
+ [ 5.0 ],
+ [ 8.0 ]
+ ],
+ [
+ [ 11.0 ],
+ [ 14.0 ],
+ [ 17.0 ]
+ ],
+ [
+ [ 20.0 ],
+ [ 23.0 ],
+ [ 26.0 ]
+ ]
+ ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 3, 3, 1 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), y );
+
+ expected = [
+ [
+ [ 0.0, 2.0, 3.0 ],
+ [ 0.0, 5.0, 6.0 ],
+ [ 0.0, 8.0, 9.0 ]
+ ],
+ [
+ [ 0.0, 11.0, 12.0 ],
+ [ 0.0, 14.0, 15.0 ],
+ [ 0.0, 17.0, 18.0 ]
+ ],
+ [
+ [ 0.0, 20.0, 21.0 ],
+ [ 0.0, 23.0, 24.0 ],
+ [ 0.0, 26.0, 27.0 ]
+ ]
+ ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 3, 3, 1 ] );
+
+ out = splice( x, new Slice( 1, 2, 1 ), y );
+
+ expected = [
+ [
+ [ 1.0, 0.0, 3.0 ],
+ [ 4.0, 0.0, 6.0 ],
+ [ 7.0, 0.0, 9.0 ]
+ ],
+ [
+ [ 10.0, 0.0, 12.0 ],
+ [ 13.0, 0.0, 15.0 ],
+ [ 16.0, 0.0, 18.0 ]
+ ],
+ [
+ [ 19.0, 0.0, 21.0 ],
+ [ 22.0, 0.0, 24.0 ],
+ [ 25.0, 0.0, 27.0 ]
+ ]
+ ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 3, 3, 1 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), new Slice( 2, 3, null ), [ y, y ] );
+
+ expected = [
+ [
+ [ 0.0, 2.0, 0.0 ],
+ [ 0.0, 5.0, 0.0 ],
+ [ 0.0, 8.0, 0.0 ]
+ ],
+ [
+ [ 0.0, 11.0, 0.0 ],
+ [ 0.0, 14.0, 0.0 ],
+ [ 0.0, 17.0, 0.0 ]
+ ],
+ [
+ [ 0.0, 20.0, 0.0 ],
+ [ 0.0, 23.0, 0.0 ],
+ [ 0.0, 26.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 = [
+ [
+ [ 4.0, 5.0, 6.0 ],
+ [ 7.0, 8.0, 9.0 ]
+ ],
+ [
+ [ 13.0, 14.0, 15.0 ],
+ [ 16.0, 17.0, 18.0 ]
+ ],
+ [
+ [ 22.0, 23.0, 24.0 ],
+ [ 25.0, 26.0, 27.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, 3.0 ],
+ [ 7.0, 8.0, 9.0 ]
+ ],
+ [
+ [ 10.0, 11.0, 12.0 ],
+ [ 16.0, 17.0, 18.0 ]
+ ],
+ [
+ [ 19.0, 20.0, 21.0 ],
+ [ 25.0, 26.0, 27.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 ), new Slice( 2, 3, 1 ), {
+ 'dim': -2
+ });
+
+ expected = [
+ [
+ [ 4.0, 5.0, 6.0 ]
+ ],
+ [
+ [ 13.0, 14.0, 15.0 ]
+ ],
+ [
+ [ 22.0, 23.0, 24.0 ]
+ ]
+ ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 3, 1, 3 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), y, {
+ 'dim': -2
+ });
+
+ expected = [
+ [
+ [ 0.0, 0.0, 0.0 ],
+ [ 4.0, 5.0, 6.0 ],
+ [ 7.0, 8.0, 9.0 ]
+ ],
+ [
+ [ 0.0, 0.0, 0.0 ],
+ [ 13.0, 14.0, 15.0 ],
+ [ 16.0, 17.0, 18.0 ]
+ ],
+ [
+ [ 0.0, 0.0, 0.0 ],
+ [ 22.0, 23.0, 24.0 ],
+ [ 25.0, 26.0, 27.0 ]
+ ]
+ ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 3, 1, 3 ] );
+
+ out = splice( x, new Slice( 1, 2, 1 ), y, {
+ 'dim': -2
+ });
+
+ expected = [
+ [
+ [ 1.0, 2.0, 3.0 ],
+ [ 0.0, 0.0, 0.0 ],
+ [ 7.0, 8.0, 9.0 ]
+ ],
+ [
+ [ 10.0, 11.0, 12.0 ],
+ [ 0.0, 0.0, 0.0 ],
+ [ 16.0, 17.0, 18.0 ]
+ ],
+ [
+ [ 19.0, 20.0, 21.0 ],
+ [ 0.0, 0.0, 0.0 ],
+ [ 25.0, 26.0, 27.0 ]
+ ]
+ ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 3, 1, 3 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), new Slice( 2, 3, 1 ), [ y, y ], {
+ 'dim': -2
+ });
+
+ expected = [
+ [
+ [ 0.0, 0.0, 0.0 ],
+ [ 4.0, 5.0, 6.0 ],
+ [ 0.0, 0.0, 0.0 ]
+ ],
+ [
+ [ 0.0, 0.0, 0.0 ],
+ [ 13.0, 14.0, 15 ],
+ [ 0.0, 0.0, 0.0 ]
+ ],
+ [
+ [ 0.0, 0.0, 0.0 ],
+ [ 22.0, 23.0, 24.0 ],
+ [ 0.0, 0.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': -3
+ });
+
+ expected = [
+ [
+ [ 10.0, 11.0, 12.0 ],
+ [ 13.0, 14.0, 15.0 ],
+ [ 16.0, 17.0, 18.0 ]
+ ],
+ [
+ [ 19.0, 20.0, 21.0 ],
+ [ 22.0, 23.0, 24.0 ],
+ [ 25.0, 26.0, 27.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, 5.0, 6.0 ],
+ [ 7.0, 8.0, 9.0 ]
+ ],
+ [
+ [ 19.0, 20.0, 21.0 ],
+ [ 22.0, 23.0, 24.0 ],
+ [ 25.0, 26.0, 27.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 ), new Slice( 2, 3, 1 ), {
+ 'dim': -3
+ });
+
+ expected = [
+ [
+ [ 10.0, 11.0, 12.0 ],
+ [ 13.0, 14.0, 15.0 ],
+ [ 16.0, 17.0, 18.0 ]
+ ]
+ ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 1, 3, 3 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), y, {
+ 'dim': -3
+ });
+
+ expected = [
+ [
+ [ 0.0, 0.0, 0.0 ],
+ [ 0.0, 0.0, 0.0 ],
+ [ 0.0, 0.0, 0.0 ]
+ ],
+ [
+ [ 10.0, 11.0, 12.0 ],
+ [ 13.0, 14.0, 15.0 ],
+ [ 16.0, 17.0, 18.0 ]
+ ],
+ [
+ [ 19.0, 20.0, 21.0 ],
+ [ 22.0, 23.0, 24.0 ],
+ [ 25.0, 26.0, 27.0 ]
+ ]
+ ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 1, 3, 3 ] );
+
+ out = splice( x, new Slice( 1, 2, 1 ), y, {
+ 'dim': -3
+ });
+
+ expected = [
+ [
+ [ 1.0, 2.0, 3.0 ],
+ [ 4.0, 5.0, 6.0 ],
+ [ 7.0, 8.0, 9.0 ]
+ ],
+ [
+ [ 0.0, 0.0, 0.0 ],
+ [ 0.0, 0.0, 0.0 ],
+ [ 0.0, 0.0, 0.0 ]
+ ],
+ [
+ [ 19.0, 20.0, 21.0 ],
+ [ 22.0, 23.0, 24.0 ],
+ [ 25.0, 26.0, 27.0 ]
+ ]
+ ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ y = zeros( [ 1, 3, 3 ] );
+
+ out = splice( x, new Slice( 0, 1, 1 ), new Slice( 2, 3, 1 ), [ y, y ], {
+ 'dim': -3
+ });
+
+ expected = [
+ [
+ [ 0.0, 0.0, 0.0 ],
+ [ 0.0, 0.0, 0.0 ],
+ [ 0.0, 0.0, 0.0 ]
+ ],
+ [
+ [ 10.0, 11.0, 12.0 ],
+ [ 13.0, 14.0, 15.0 ],
+ [ 16.0, 17.0, 18.0 ]
+ ],
+ [
+ [ 0.0, 0.0, 0.0 ],
+ [ 0.0, 0.0, 0.0 ],
+ [ 0.0, 0.0, 0.0 ]
+ ]
+ ];
+
+ t.strictEqual( isndarrayLike( out ), true, 'returns expected value' );
+ t.deepEqual( ndarray2array( out ), expected, 'returns expected value' );
+
+ t.end();
+});