diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/README.md b/lib/node_modules/@stdlib/array/base/to-inserted-at/README.md
new file mode 100644
index 000000000000..13b8a01fda7a
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/README.md
@@ -0,0 +1,160 @@
+
+
+# toInsertedAt
+
+> Return a new array containing every element from an input array, with a provided value inserted at a specified index.
+
+
+
+
+
+
+
+
+
+
+
+## Usage
+
+```javascript
+var toInsertedAt = require( '@stdlib/array/base/to-inserted-at' );
+```
+
+#### toInsertedAt( x, index, value )
+
+Returns a new array containing every element from an input array, with a provided value inserted at a specified index.
+
+```javascript
+var x = [ 1, 2, 3, 4 ];
+
+var out = toInsertedAt( x, 0, 5 );
+// returns [ 5, 1, 2, 3, 4 ]
+
+out = toInsertedAt( x, -1, 6 );
+// returns [ 1, 2, 3, 4, 6 ]
+```
+
+The function accepts the following arguments:
+
+- **x**: an input array.
+- **index**: element index.
+- **value**: value to insert.
+
+### toInsertedAt.assign( x, index, value, out, stride, offset )
+
+Copies elements from one array to another array and sets the element at the specified index to a provided value.
+
+```javascript
+var x = [ 1, 2, 3, 4 ];
+
+var out = [ 0, 0, 0, 0, 0 ];
+var arr = toInsertedAt.assign( x, 0, 5, out, 1, 0 );
+// returns [ 5, 1, 2, 3, 4 ]
+
+var bool = ( arr === out );
+// returns true
+```
+
+The function accepts the following arguments:
+
+- **x**: an input array.
+- **index**: element index.
+- **value**: value to insert.
+- **out**: output array.
+- **stride**: output array stride.
+- **offset**: output array offset.
+
+
+
+
+
+
+
+
+
+## Notes
+
+- Negative indices are resolved relative to the last array element, with the last element corresponding to `-1`.
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+```javascript
+var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
+var toInsertedAt = require( '@stdlib/array/base/to-inserted-at' );
+
+// Define an array:
+var opts = {
+ 'dtype': 'generic'
+};
+var x = discreteUniform( 5, -100, 100, opts );
+
+// Define an array containing random index values:
+var indices = discreteUniform( 100, -x.length, x.length-1, opts );
+
+// Define an array with random values to set:
+var values = discreteUniform( indices.length, -10000, 10000, opts );
+
+// Randomly set elements in the input array:
+var i;
+for ( i = 0; i < indices.length; i++ ) {
+ console.log( 'x = [%s]', toInsertedAt( x, indices[ i ], values[ i ] ).join( ',' ) );
+}
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/benchmark/benchmark.assign.length.js b/lib/node_modules/@stdlib/array/base/to-inserted-at/benchmark/benchmark.assign.length.js
new file mode 100644
index 000000000000..bfae3a659636
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/benchmark/benchmark.assign.length.js
@@ -0,0 +1,100 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var isArray = require( '@stdlib/assert/is-array' );
+var ones = require( '@stdlib/array/base/ones' );
+var zeros = require( '@stdlib/array/base/zeros' );
+var pkg = require( './../package.json' ).name;
+var toInsertedAt = require( './../lib' );
+
+
+// FUNCTIONS //
+
+/**
+* Creates a benchmark function.
+*
+* @private
+* @param {PositiveInteger} len - array length
+* @returns {Function} benchmark function
+*/
+function createBenchmark( len ) {
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var out;
+ var v;
+ var x;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ x = ones( len );
+ out = zeros( len );
+ v = toInsertedAt.assign( x, i%len, i, out, 1, 0 );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an array' );
+ }
+ }
+ b.toc();
+ if ( !isArray( v ) ) {
+ b.fail( 'should return an array' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+/**
+* Main execution sequence.
+*
+* @private
+*/
+function main() {
+ var len;
+ var min;
+ var max;
+ var f;
+ var i;
+
+ min = 1; // 10^min
+ max = 6; // 10^max
+
+ for ( i = min; i <= max; i++ ) {
+ len = pow( 10, i );
+
+ f = createBenchmark( len );
+ bench( pkg+':assign:dtype=generic,len='+len, f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/array/base/to-inserted-at/benchmark/benchmark.length.js
new file mode 100644
index 000000000000..c0631b9af309
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/benchmark/benchmark.length.js
@@ -0,0 +1,97 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var isArray = require( '@stdlib/assert/is-array' );
+var ones = require( '@stdlib/array/base/ones' );
+var pkg = require( './../package.json' ).name;
+var toInsertedAt = require( './../lib' );
+
+
+// FUNCTIONS //
+
+/**
+* Creates a benchmark function.
+*
+* @private
+* @param {PositiveInteger} len - array length
+* @returns {Function} benchmark function
+*/
+function createBenchmark( len ) {
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var out;
+ var x;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ x = ones( len );
+ out = toInsertedAt( x, i%len, i );
+ if ( out.length !== len + 1 ) {
+ b.fail( 'unexpected length' );
+ }
+ }
+ b.toc();
+ if ( !isArray( out ) ) {
+ b.fail( 'should return an array' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+/**
+* Main execution sequence.
+*
+* @private
+*/
+function main() {
+ var len;
+ var min;
+ var max;
+ var f;
+ var i;
+
+ min = 1; // 10^min
+ max = 6; // 10^max
+
+ for ( i = min; i <= max; i++ ) {
+ len = pow( 10, i );
+
+ f = createBenchmark( len );
+ bench( pkg+':dtype=generic,len='+len, f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/docs/repl.txt b/lib/node_modules/@stdlib/array/base/to-inserted-at/docs/repl.txt
new file mode 100644
index 000000000000..a20df8934378
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/docs/repl.txt
@@ -0,0 +1,79 @@
+
+{{alias}}( x, index, value )
+ Returns a new array containing every element from an input array, with a
+ provided value inserted at a specified index.
+
+ Negative indices are resolved relative to the last array element, with the
+ last element corresponding to `-1`.
+
+ Parameters
+ ----------
+ x: ArrayLikeObject
+ Input array.
+
+ index: integer
+ Index of the element to be inserted.
+
+ value: any
+ Value to insert.
+
+ Returns
+ -------
+ out: ArrayLikeObject
+ Output array.
+
+ Examples
+ --------
+ > var x = [ 1, 2, 3, 4 ];
+ > {{alias}}( x, 0, 5 )
+ [ 5, 1, 2, 3, 4 ]
+ > {{alias}}( x, -1, 6 )
+ [ 1, 2, 3, 4, 6 ]
+ > x
+ [ 1, 2, 3, 4 ]
+
+
+{{alias}}.assign( x, index, value, out, stride, offset )
+ Copies elements from one array to another array and with a provided value
+ inserted at a specified index.
+
+ Negative indices are resolved relative to the last array element, with the
+ last element corresponding to `-1`.
+
+ Parameters
+ ----------
+ x: ArrayLikeObject
+ Input array.
+
+ index: integer
+ Index of the element to be inserted.
+
+ value: any
+ Value to insert.
+
+ out: ArrayLikeObject
+ Output array.
+
+ stride: integer
+ Output array stride.
+
+ offset: integer
+ Output array offset.
+
+ Returns
+ -------
+ out: ArrayLikeObject
+ Output array.
+
+ Examples
+ --------
+ > var x = [ 1, 2, 3, 4 ];
+ > var out = [ 0, 0, 0, 0, 0 ];
+ > var arr = {{alias}}.assign( x, 0, 5, out, 1, 0 )
+ [ 5, 1, 2, 3, 4 ]
+ > var bool = ( arr === out )
+ true
+
+ See Also
+ --------
+
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/base/to-inserted-at/docs/types/index.d.ts
new file mode 100644
index 000000000000..8dcf69c29794
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/docs/types/index.d.ts
@@ -0,0 +1,251 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+// TypeScript Version: 4.1
+
+///
+
+import { Collection, RealTypedArray, ComplexTypedArray, AccessorArrayLike } from '@stdlib/types/array';
+import { ComplexLike } from '@stdlib/types/complex';
+
+/**
+* Interface describing `toInsertedAt`.
+*/
+interface Array2InsertedAt {
+ /**
+ * Returns a new array containing every element from an input array, with a provided value inserted at a specified index.
+ *
+ * @param x - input array
+ * @param index - index at which to set a provided value
+ * @param value - value to insert
+ * @returns output array
+ *
+ * @example
+ * var Complex128Array = require( '@stdlib/array/complex128' );
+ * var Complex128 = require( '@stdlib/complex/float64/ctor' );
+ *
+ * var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ *
+ * var out = toInsertedAt( x, 0, new Complex128( 7.0, 8.0 ) );
+ * // returns [ 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
+ */
+ ( x: T, index: number, value: ComplexLike ): T;
+
+ /**
+ * Returns a new array containing every element from an input array, with a provided value inserted at a specified index.
+ *
+ * @param x - input array
+ * @param index - index at which to set a provided value
+ * @param value - value to insert
+ * @returns output array
+ *
+ * @example
+ * var Float64Array = require( '@stdlib/array/float64' );
+ *
+ * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] );
+ *
+ * var out = toInsertedAt( x, 0, 5.0 );
+ * // returns [ 5.0, 1.0, 2.0, 3.0 ]
+ */
+ ( x: T, index: number, value: number ): T; // eslint-disable-line @typescript-eslint/unified-signatures
+
+ /**
+ * Returns a new array containing every element from an input array, with a provided value inserted at a specified index.
+ *
+ * @param x - input array
+ * @param index - index at which to set a provided value
+ * @param value - value to insert
+ * @returns output array
+ *
+ * @example
+ * var x = [ 1, 2, 3 ];
+ *
+ * var out = toInsertedAt( x, 0, 7 );
+ * // returns [ 7, 1, 2, 3 ]
+ *
+ * @example
+ * var x = [ 1, 2, 3, 4, 5, 6 ];
+ *
+ * var out = toInsertedAt( x, 1, 8 );
+ * // returns [ 1, 8, 2, 3, 4, 5, 6 ]
+ */
+ ( x: Collection, index: number, value: T ): Array;
+
+ /**
+ * Copies elements from one array to another array and inserts the element at the specified index to a provided value.
+ *
+ * @param x - input array
+ * @param index - index at which to set a provided value
+ * @param value - value to insert
+ * @param out - output array
+ * @param stride - output array stride
+ * @param offset - output array offset
+ * @returns output array
+ *
+ * @example
+ * var Float64Array = require( '@stdlib/array/float64' );
+ *
+ * var x = [ 1, 2, 3, 4 ];
+ *
+ * var out = new Float64Array( [ 0, 0, 0, 0, 0 ] );
+ * var arr = toInsertedAt.assign( x, 0, 5, out, 1, 0 );
+ * // returns [ 5, 1, 2, 3, 4 ]
+ *
+ * var bool = ( arr === out );
+ * // returns true
+ */
+ assign( x: Collection | AccessorArrayLike, index: number, value: number, out: T, stride: number, offset: number ): T;
+
+ /**
+ * Copies elements from one array to another array and inserts the element at the specified index to a provided value.
+ *
+ * @param x - input array
+ * @param index - index at which to set a provided value
+ * @param value - value to insert
+ * @param out - output array
+ * @param stride - output array stride
+ * @param offset - output array offset
+ * @returns output array
+ *
+ * @example
+ * var Complex128Array = require( '@stdlib/array/complex128' );
+ * var Complex128 = require( '@stdlib/complex/float64/ctor' );
+ *
+ * var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ *
+ * var out = new Complex128Array( 4 );
+ * var arr = toInsertedAt.assign( x, 0, new Complex128( 7.0, 8.0 ), out, 1, 0 );
+ * // returns [ 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
+ *
+ * var bool = ( arr === out );
+ * // returns true
+ */
+ assign( x: Collection | AccessorArrayLike, index: number, value: ComplexLike, out: T, stride: number, offset: number ): T; // eslint-disable-line @typescript-eslint/unified-signatures
+
+ /**
+ * Copies elements from one array to another array and inserts the element at the specified index to a provided value.
+ *
+ * @param x - input array
+ * @param index - index at which to set a provided value
+ * @param value - value to insert
+ * @param out - output array
+ * @param stride - output array stride
+ * @param offset - output array offset
+ * @returns output array
+ *
+ * @example
+ * var x = [ 1, 2, 3, 4 ];
+ *
+ * var out = [ 0, 0, 0, 0, 0 ];
+ * var arr = toInsertedAt.assign( x, 0, 5, out, 1, 0 );
+ * // returns [ 5, 1, 2, 3, 4 ]
+ *
+ * var bool = ( arr === out );
+ * // returns true
+ */
+ assign( x: Collection | AccessorArrayLike, index: number, value: U, out: Array, stride: number, offset: number ): Array;
+
+ /**
+ * Copies elements from one array to another array and inserts the element at the specified index to a provided value.
+ *
+ * @param x - input array
+ * @param index - index at which to set a provided value
+ * @param value - value to insert
+ * @param out - output array
+ * @param stride - output array stride
+ * @param offset - output array offset
+ * @returns output array
+ *
+ * @example
+ * var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
+ *
+ * var x = toAccessorArray( [ 1, 2, 3, 4 ] );
+ *
+ * var out = toAccessorArray( [ 0, 0, 0, 0, 0 ] );
+ * var arr = toInsertedAt.assign( x, 0, 5, out, 1, 0 );
+ *
+ * var v = out[ 0 ];
+ * // returns 5
+ *
+ * var bool = ( arr === out );
+ * // returns true
+ */
+ assign( x: Collection | AccessorArrayLike, index: number, value: U, out: AccessorArrayLike, stride: number, offset: number ): AccessorArrayLike;
+
+ /**
+ * Copies elements from one array to another array and inserts the element at the specified index to a provided value.
+ *
+ * @param x - input array
+ * @param index - index at which to set a provided value
+ * @param value - value to insert
+ * @param out - output array
+ * @param stride - output array stride
+ * @param offset - output array offset
+ * @returns output array
+ *
+ * @example
+ * var x = [ 1, 2, 3, 4 ];
+ *
+ * var out = [ 0, 0, 0, 0, 0 ];
+ * var arr = toInsertedAt.assign( x, 0, 5, out, 1, 0 );
+ * // returns [ 5, 1, 2, 3, 4 ]
+ *
+ * var bool = ( arr === out );
+ * // returns true
+ */
+ assign( x: Collection | AccessorArrayLike, index: number, value: U, out: Collection, stride: number, offset: number ): Collection;
+}
+
+/**
+* Returns a new array containing every element from an input array, with a provided value inserted at a specified index.
+*
+* @param x - input array
+* @param index - index at which to set a provided value
+* @param value - value to insert
+* @returns output array
+*
+* @example
+* var x = [ 1, 2, 3 ];
+*
+* var out = toInsertedAt( x, 0, 7 );
+* // returns [ 7, 1, 2, 3 ]
+*
+* @example
+* var x = [ 1, 2, 3, 4, 5, 6 ];
+*
+* var out = toInsertedAt( x, 1, 8 );
+* // returns [ 1, 8, 2, 3, 4, 5, 6 ]
+*
+* @example
+* var Float64Array = require( '@stdlib/array/float64' );
+*
+* var x = [ 1, 2, 3, 4 ];
+*
+* var out = new Float64Array( [ 0, 0, 0, 0, 0 ] );
+* var arr = toInsertedAt.assign( x, 0, 5, out, 1, 0 );
+* // returns [ 5, 1, 2, 3, 4 ]
+*
+* var bool = ( arr === out );
+* // returns true
+*/
+declare var toInsertedAt: Array2InsertedAt;
+
+
+// EXPORTS //
+
+export = toInsertedAt;
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/docs/types/test.ts b/lib/node_modules/@stdlib/array/base/to-inserted-at/docs/types/test.ts
new file mode 100644
index 000000000000..779968b2ea2e
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/docs/types/test.ts
@@ -0,0 +1,170 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import Complex128Array = require( '@stdlib/array/complex128' );
+import Complex64Array = require( '@stdlib/array/complex64' );
+import toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
+import toInsertedAt = require( './index' );
+
+
+// TESTS //
+
+// The function returns an updated array...
+{
+ toInsertedAt( [ 1, 2, 3, 4 ], 0, 5 ); // $ExpectType number[]
+ toInsertedAt( new Complex128Array( 5 ), 0, { 're': 1.0, 'im': 1.0 } ); // $ExpectType Complex128Array
+ toInsertedAt( new Complex64Array( 5 ), 0, { 're': 1.0, 'im': 1.0 } ); // $ExpectType Complex64Array
+ toInsertedAt( toAccessorArray( [ 1, 2, 3, 4 ] ), 0, 5 ); // $ExpectType number[]
+}
+
+// The compiler throws an error if the function is provided a first argument which is not a collection...
+{
+ toInsertedAt( 5, 0, 5 ); // $ExpectError
+ toInsertedAt( true, 0, 5 ); // $ExpectError
+ toInsertedAt( false, 0, 5 ); // $ExpectError
+ toInsertedAt( null, 0, 5 ); // $ExpectError
+ toInsertedAt( void 0, 0, 5 ); // $ExpectError
+ toInsertedAt( {}, 0, 5 ); // $ExpectError
+ toInsertedAt( ( x: number ): number => x, 0, 5 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a second argument which is not a number...
+{
+ const x = [ 1, 2, 3, 4 ];
+
+ toInsertedAt( x, 'abc', 5 ); // $ExpectError
+ toInsertedAt( x, true, 5 ); // $ExpectError
+ toInsertedAt( x, false, 5 ); // $ExpectError
+ toInsertedAt( x, null, 5 ); // $ExpectError
+ toInsertedAt( x, void 0, 5 ); // $ExpectError
+ toInsertedAt( x, [ '1' ], 5 ); // $ExpectError
+ toInsertedAt( x, {}, 5 ); // $ExpectError
+ toInsertedAt( x, ( x: number ): number => x, 5 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const x = [ 1, 2, 3, 4 ];
+
+ toInsertedAt(); // $ExpectError
+ toInsertedAt( x ); // $ExpectError
+ toInsertedAt( x, 0 ); // $ExpectError
+ toInsertedAt( x, 0, 0, 5 ); // $ExpectError
+}
+
+// Attached to the main export is an `assign` method which returns a collection...
+{
+ const x = [ 1, 2, 3, 4 ];
+ const y = new Complex128Array( 4 );
+
+ toInsertedAt.assign( x, 0, 5, [ 0, 0, 0, 0 ], 1, 0 ); // $ExpectType number[]
+ toInsertedAt.assign( x, 0, 5, new Float64Array( 4 ), 1, 0 ); // $ExpectType Float64Array
+ toInsertedAt.assign( x, 0, 5, new Float32Array( 4 ), 1, 0 ); // $ExpectType Float32Array
+ toInsertedAt.assign( x, 0, 5, new Int32Array( 4 ), 1, 0 ); // $ExpectType Int32Array
+ toInsertedAt.assign( x, 0, 5, new Int16Array( 4 ), 1, 0 ); // $ExpectType Int16Array
+ toInsertedAt.assign( x, 0, 5, new Int8Array( 4 ), 1, 0 ); // $ExpectType Int8Array
+ toInsertedAt.assign( x, 0, 5, new Uint32Array( 4 ), 1, 0 ); // $ExpectType Uint32Array
+ toInsertedAt.assign( x, 0, 5, new Uint16Array( 4 ), 1, 0 ); // $ExpectType Uint16Array
+ toInsertedAt.assign( x, 0, 5, new Uint8Array( 4 ), 1, 0 ); // $ExpectType Uint8Array
+ toInsertedAt.assign( x, 0, 5, new Uint8ClampedArray( 4 ), 1, 0 ); // $ExpectType Uint8ClampedArray
+ toInsertedAt.assign( y, 0, { 're': 1.0, 'im': 1.0 }, new Complex128Array( 4 ), 1, 0 ); // $ExpectType Complex128Array
+ toInsertedAt.assign( y, 0, { 're': 1.0, 'im': 1.0 }, new Complex64Array( 4 ), 1, 0 ); // $ExpectType Complex64Array
+}
+
+// The compiler throws an error if the `assign` method is provided a first argument which is not an array-like object...
+{
+ const out = [ 0, 0, 0, 0 ];
+
+ toInsertedAt.assign( 1, 0, 5, out, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( true, 0, 5, out, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( false, 0, 5, out, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( null, 0, 5, out, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( void 0, 0, 5, out, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( {}, 0, 5, out, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided a second argument which is not a number...
+{
+ const x = [ 1, 2, 3, 4 ];
+ const out = [ 0, 0, 0, 0 ];
+
+ toInsertedAt.assign( x, '1', 5, out, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, true, 5, out, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, false, 5, out, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, null, 5, out, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, void 0, 5, out, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, [], 5, out, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, {}, 5, out, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, ( x: number ): number => x, 5, out, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided a fourth argument which is not an array-like object...
+{
+ const x = [ 1, 2, 3, 4 ];
+
+ toInsertedAt.assign( x, 0, 5, 1, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 5, true, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 5, false, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 5, null, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 5, void 0, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 5, {}, 1, 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 5, ( x: number ): number => x, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided a fifth argument which is not a number...
+{
+ const x = [ 1, 2, 3, 4 ];
+ const out = [ 0, 0, 0, 0 ];
+
+ toInsertedAt.assign( x, 0, 1, out, '1', 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, true, 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, false, 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, null, 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, void 0, 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, [], 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, {}, 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, ( x: number ): number => x, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided a sixth argument which is not a number...
+{
+ const x = [ 1, 2, 3, 4 ];
+ const out = [ 0, 0, 0, 0 ];
+
+ toInsertedAt.assign( x, 0, 1, out, 1, '1' ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, 1, true ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, 1, false ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, 1, null ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, 1, void 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, 1, [] ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, 1, {} ); // $ExpectError
+ toInsertedAt.assign( x, 0, 1, out, 1, ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided an unsupported number of arguments...
+{
+ const x = [ 1, 2, 3, 4 ];
+ const out = [ 0, 0, 0, 0 ];
+
+ toInsertedAt.assign(); // $ExpectError
+ toInsertedAt.assign( x ); // $ExpectError
+ toInsertedAt.assign( x, 0 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 0, out ); // $ExpectError
+ toInsertedAt.assign( x, 0, 0, out, 1 ); // $ExpectError
+ toInsertedAt.assign( x, 0, 0, out, 1, 0, {} ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/examples/index.js b/lib/node_modules/@stdlib/array/base/to-inserted-at/examples/index.js
new file mode 100644
index 000000000000..545db386cc07
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/examples/index.js
@@ -0,0 +1,40 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
+var toInsertedAt = require( './../lib' );
+
+// Define an array:
+var opts = {
+ 'dtype': 'generic'
+};
+var x = discreteUniform( 5, -100, 100, opts );
+
+// Define an array containing random index values:
+var indices = discreteUniform( 100, -x.length, x.length-1, opts );
+
+// Define an array with random values to set:
+var values = discreteUniform( indices.length, -10000, 10000, opts );
+
+// Randomly set elements in the input array:
+var i;
+for ( i = 0; i < indices.length; i++ ) {
+ console.log( 'x = [%s]', toInsertedAt( x, indices[ i ], values[ i ] ).join( ',' ) );
+}
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/lib/assign.js b/lib/node_modules/@stdlib/array/base/to-inserted-at/lib/assign.js
new file mode 100644
index 000000000000..f6a2dd38819a
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/lib/assign.js
@@ -0,0 +1,244 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var isComplexDataType = require( '@stdlib/array/base/assert/is-complex-floating-point-data-type' );
+var isBooleanDataType = require( '@stdlib/array/base/assert/is-boolean-data-type' );
+var isComplexLike = require( '@stdlib/assert/is-complex-like' );
+var Boolean = require( '@stdlib/boolean/ctor' );
+var arraylike2object = require( '@stdlib/array/base/arraylike2object' );
+var reinterpret = require( '@stdlib/strided/base/reinterpret-complex' );
+var reinterpretBoolean = require( '@stdlib/strided/base/reinterpret-boolean' );
+var normalizeIndex = require( '@stdlib/ndarray/base/normalize-index' );
+var real = require( '@stdlib/complex/float64/real' );
+var imag = require( '@stdlib/complex/float64/imag' );
+var format = require( '@stdlib/string/format' );
+
+
+// FUNCTIONS //
+
+/**
+* Copies elements from one array to another array and with a provided value inserted at a specified index.
+*
+* @private
+* @param {Collection} x - input array
+* @param {integer} index - element index
+* @param {*} value - value to insert
+* @param {Collection} out - output array
+* @param {integer} stride - output array stride
+* @param {NonNegativeInteger} offset - output array offset
+* @returns {Collection} output array
+*
+* @example
+* var x = [ 1, 2, 3, 4 ];
+*
+* var out = [ 0, 0, 0, 0, 0 ];
+* var arr = indexed( x, 0, 5, out, 1, 0 );
+* // returns [ 5, 1, 2, 3, 4 ]
+*
+* var bool = ( arr === out );
+* // returns true
+*/
+function indexed( x, index, value, out, stride, offset ) {
+ var io;
+ var i;
+ var j;
+
+ io = offset;
+ j = 0;
+ for ( i = 0; i < x.length + 1; i++ ) {
+ if ( i === index ) {
+ out[ io ] = value;
+ io += stride;
+ } else {
+ out[ io ] = x[ j ];
+ io += stride;
+ j += 1;
+ }
+ }
+ return out;
+}
+
+/**
+* Copies elements from one accessor array to another accessor array and with a provided value inserted at a specified index.
+*
+* @private
+* @param {Object} x - input array object
+* @param {integer} index - element index
+* @param {*} value - value to insert
+* @param {Object} out - output array object
+* @param {integer} stride - output array stride
+* @param {NonNegativeInteger} offset - output array offset
+* @returns {Collection} output array
+*
+* @example
+* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
+* var arraylike2object = require( '@stdlib/array/base/arraylike2object' );
+*
+* var x = toAccessorArray( [ 1, 2, 3, 4 ] );
+*
+* var out = toAccessorArray( [ 0, 0, 0, 0, 0 ] );
+* var arr = accessors( arraylike2object( x ), 0, 5, arraylike2object( out ), 1, 0 );
+*
+* var v = arr.get( 0 );
+* // returns 5
+*/
+function accessors( x, index, value, out, stride, offset ) {
+ var xdata;
+ var odata;
+ var xget;
+ var oset;
+ var io;
+ var i;
+ var j;
+
+ xdata = x.data;
+ odata = out.data;
+
+ xget = x.accessors[ 0 ];
+ oset = out.accessors[ 1 ];
+
+ io = offset;
+ j = 0;
+ for ( i = 0; i < xdata.length + 1; i++ ) {
+ if ( i === index ) {
+ oset( odata, io, value );
+ io += stride;
+ } else {
+ oset( odata, io, xget( xdata, j ) );
+ io += stride;
+ j += 1;
+ }
+ }
+
+ return odata;
+}
+
+/**
+* Copies elements from one complex array to another complex array and with a provided value inserted at a specified index.
+*
+* @private
+* @param {Collection} x - real-valued floating-point input array view
+* @param {integer} index - element index
+* @param {ComplexLike} value - value to insert
+* @param {Collection} out - real-valued floating-point output array view
+* @param {integer} stride - output array stride
+* @param {NonNegativeInteger} offset - output array offset
+* @returns {Collection} output array view
+*
+* @example
+* var Complex128 = require( '@stdlib/complex/float64/ctor' );
+* var Float64Array = require( '@stdlib/array/float64' );
+* var arraylike2object = require( '@stdlib/array/base/arraylike2object' );
+*
+* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
+*
+* var out = new Float64Array( 6 );
+* var arr = complex( x, 0, new Complex128( 5.0, 6.0 ), out, 1, 0 );
+* // returns [ 5.0, 6.0, 1.0, 2.0, 3.0, 4.0 ]
+*/
+function complex( x, index, value, out, stride, offset ) {
+ var so;
+ var io;
+ var i;
+ var j;
+
+ so = stride * 2; // multiply by 2, as real-valued array consists of interleaved real and imaginary components
+ io = offset * 2;
+ j = 0;
+ for ( i = 0; i < ( x.length + 1 ) / 2; i++ ) {
+ if ( i === index ) {
+ out[ io ] = real( value );
+ out[ io + 1 ] = imag( value );
+ io += so;
+ } else {
+ out[ io ] = x[ j ];
+ out[ io + 1 ] = x[ j + 1 ];
+ io += so;
+ j += 2;
+ }
+ }
+ return out;
+}
+
+
+// MAIN //
+
+/**
+* Copies elements from one array to another array and with a provided value inserted at a specified index.
+*
+* @param {Collection} x - input array
+* @param {integer} index - element index
+* @param {*} value - value to insert
+* @param {Collection} out - output array
+* @param {integer} stride - output array stride
+* @param {NonNegativeInteger} offset - output array offset
+* @throws {RangeError} second argument must not exceed array bounds
+* @returns {Collection} output array
+*
+* @example
+* var x = [ 1, 2, 3, 4 ];
+*
+* var out = [ 0, 0, 0, 0, 0 ];
+* var arr = assign( x, 0, 5, out, 1, 0 );
+* // returns [ 5, 1, 2, 3, 4 ]
+*
+* var bool = ( arr === out );
+* // returns true
+*/
+function assign( x, index, value, out, stride, offset ) {
+ var xo;
+ var oo;
+
+ index = normalizeIndex( index, x.length );
+ if ( index < 0 ) {
+ throw new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%d`.', index ) );
+ }
+ xo = arraylike2object( x );
+ oo = arraylike2object( out );
+ if ( xo.accessorProtocol || oo.accessorProtocol ) {
+ // Note: we only explicitly support a limited set of dtype-to-dtype pairs, as this function should not be concerned with casting rules, etc. That is left to userland...
+ if (
+ isComplexDataType( xo.dtype ) &&
+ isComplexDataType( oo.dtype ) &&
+ isComplexLike( value )
+ ) {
+ complex( reinterpret( x, 0 ), index, value, reinterpret( out, 0 ), stride, offset ); // eslint-disable-line max-len
+ return out;
+ }
+ if (
+ isBooleanDataType( xo.dtype ) &&
+ isBooleanDataType( oo.dtype )
+ ) {
+ indexed( reinterpretBoolean( x, 0 ), index, Boolean( value ), reinterpretBoolean( out, 0 ), stride, offset ); // eslint-disable-line max-len
+ return out;
+ }
+ accessors( xo, index, value, oo, stride, offset );
+ return out;
+ }
+ indexed( x, index, value, out, stride, offset );
+ return out;
+}
+
+
+// EXPORTS //
+
+module.exports = assign;
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/lib/index.js b/lib/node_modules/@stdlib/array/base/to-inserted-at/lib/index.js
new file mode 100644
index 000000000000..e703a37f5d78
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/lib/index.js
@@ -0,0 +1,64 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+/**
+* Return a new array containing every element from an input array, with a provided value inserted at a specified index.
+*
+* @module @stdlib/array/base/to-inserted-at
+*
+* @example
+* var toInsertedAt = require( '@stdlib/array/base/to-inserted-at' );
+*
+* var x = [ 1, 2, 3, 4 ];
+*
+* var v = toInsertedAt( x, 0, 5 );
+* // returns [ 5, 1, 2, 3, 4 ]
+*
+* v = toInsertedAt( x, -2, -1 );
+* // returns [ 1, 2, 3, -1, 4 ]
+*
+* @example
+* var toInsertedAt = require( '@stdlib/array/base/to-inserted-at' );
+*
+* var x = [ 1, 2, 3, 4 ];
+*
+* var out = [ 0, 0, 0, 0 ];
+* var arr = toInsertedAt.assign( x, 0, 5, out, 1, 0 );
+* // returns [ 5, 1, 2, 3, 4 ]
+*
+* var bool = ( arr === out );
+* // returns true
+*/
+
+// MODULES //
+
+var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
+var main = require( './main.js' );
+var assign = require( './assign.js' );
+
+
+// MAIN //
+
+setReadOnly( main, 'assign', assign );
+
+
+// EXPORTS //
+
+module.exports = main;
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/lib/main.js b/lib/node_modules/@stdlib/array/base/to-inserted-at/lib/main.js
new file mode 100644
index 000000000000..493839822e31
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/lib/main.js
@@ -0,0 +1,68 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var normalizeIndex = require( '@stdlib/ndarray/base/normalize-index' );
+var zeros = require( '@stdlib/array/zeros' );
+var dtype = require( '@stdlib/array/dtype' );
+var format = require( '@stdlib/string/format' );
+var assign = require( './assign.js' );
+
+
+// MAIN //
+
+/**
+* Returns a new array containing every element from an input array, with a provided value inserted at a specified index.
+*
+* @param {Collection} x - input array
+* @param {integer} index - element index
+* @param {*} value - value to insert
+* @throws {RangeError} second argument must not exceed array bounds
+* @returns {Collection} output array
+*
+* @example
+* var x = [ 1, 2, 3, 4 ];
+*
+* var v = toInsertedAt( x, 0, 5 );
+* // returns [ 5, 1, 2, 3, 4 ]
+*
+* v = toInsertedAt( x, 1, 6 );
+* // returns [ 1, 6, 2, 3, 4 ]
+*
+* v = toInsertedAt( x, -2, 7 );
+* // returns [ 1, 2, 3, 7, 4 ]
+*/
+function toInsertedAt( x, index, value ) {
+ var out;
+
+ index = normalizeIndex( index, x.length );
+ if ( index < 0 ) {
+ throw new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%d`.', index ) );
+ }
+ out = zeros( x.length+1, dtype( x ) || 'generic' );
+ assign( x, index, value, out, 1, 0 );
+ return out;
+}
+
+
+// EXPORTS //
+
+module.exports = toInsertedAt;
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/package.json b/lib/node_modules/@stdlib/array/base/to-inserted-at/package.json
new file mode 100644
index 000000000000..8f695f76c6a0
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/package.json
@@ -0,0 +1,64 @@
+{
+ "name": "@stdlib/array/base/to-inserted-at",
+ "version": "0.0.0",
+ "description": "Return a new array with the element at the specified index inserted with a provided value.",
+ "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",
+ "base",
+ "array",
+ "typed",
+ "collection",
+ "vector",
+ "inserted",
+ "insert",
+ "inserter",
+ "copy"
+ ],
+ "__stdlib__": {}
+}
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/test/test.assign.js b/lib/node_modules/@stdlib/array/base/to-inserted-at/test/test.assign.js
new file mode 100644
index 000000000000..cc687e3e9b34
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/test/test.assign.js
@@ -0,0 +1,497 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var Int32Array = require( '@stdlib/array/int32' );
+var Float64Array = require( '@stdlib/array/float64' );
+var Complex128Array = require( '@stdlib/array/complex128' );
+var BooleanArray = require( '@stdlib/array/bool' );
+var AccessorArray = require( '@stdlib/array/base/accessor' );
+var Complex128 = require( '@stdlib/complex/float64/ctor' );
+var isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' );
+var isSameBooleanArray = require( '@stdlib/assert/is-same-booleanarray' );
+var zeros = require( '@stdlib/array/zeros' );
+var array2InsertedAt = require( './../lib/assign.js' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof array2InsertedAt, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function throws an error if provided a second argument which is out-of-bounds (generic)', function test( t ) {
+ var values;
+ var out;
+ var x;
+ var i;
+
+ x = [ 1, 2, 3 ];
+ out = zeros( x.length + 1, 'generic' );
+
+ values = [
+ 10,
+ 100,
+ 1000,
+ -10,
+ -100,
+ -1000
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ array2InsertedAt( x, value, 0, out, 1, 0 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is out-of-bounds (float64)', function test( t ) {
+ var values;
+ var out;
+ var x;
+ var i;
+
+ x = new Float64Array( [ 1.0, 2.0, 3.0 ] );
+ out = zeros( x.length + 1, 'float64' );
+
+ values = [
+ 10,
+ 100,
+ 1000,
+ -10,
+ -100,
+ -1000
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ array2InsertedAt( x, value, 0.0, out, 1, 0 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is out-of-bounds (int32)', function test( t ) {
+ var values;
+ var out;
+ var x;
+ var i;
+
+ x = new Int32Array( [ 1, 2, 3 ] );
+ out = zeros( x.length + 1, 'int32' );
+
+ values = [
+ 10,
+ 100,
+ 1000,
+ -10,
+ -100,
+ -1000
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ array2InsertedAt( x, value, 0, out, 1, 0 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is out-of-bounds (complex128)', function test( t ) {
+ var values;
+ var out;
+ var x;
+ var i;
+
+ x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ out = zeros( x.length + 1, 'complex128' );
+
+ values = [
+ 10,
+ 100,
+ 1000,
+ -10,
+ -100,
+ -1000
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ array2InsertedAt( x, value, new Complex128( 0.0, 0.0 ), out, 1, 0 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is out-of-bounds (accessors)', function test( t ) {
+ var values;
+ var out;
+ var x;
+ var i;
+
+ x = new AccessorArray( [ 1, 2, 3 ] );
+ out = new AccessorArray( zeros( x.length + 1, 'generic' ) );
+
+ values = [
+ 10,
+ 100,
+ 1000,
+ -10,
+ -100,
+ -1000
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ array2InsertedAt( x, value, 0, out, 1, 0 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is out-of-bounds (array-like)', function test( t ) {
+ var values;
+ var out;
+ var x;
+ var i;
+
+ x = {
+ 'length': 3,
+ '0': 1,
+ '1': 2,
+ '2': 3
+ };
+
+ out = {
+ 'length': 4,
+ '0': 0,
+ '1': 0,
+ '2': 0,
+ '3': 0
+ };
+
+ values = [
+ 10,
+ 100,
+ 1000,
+ -10,
+ -100,
+ -1000
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ array2InsertedAt( x, value, 0, out, 1, 0 );
+ };
+ }
+});
+
+tape( 'the function copies elements to another array and sets an element at a specified index to a provided value (generic)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = [ 1, 2, 3 ];
+
+ out = zeros( x.length + 1, 'generic' );
+ expected = [ 5, 1, 2, 3 ];
+ actual = array2InsertedAt( x, 0, 5, out, 1, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ out = zeros( ( x.length + 1 )*2, 'generic' );
+ expected = [ 1, 0, 5, 0, 2, 0, 3, 0 ];
+ actual = array2InsertedAt( x, 1, 5, out, 2, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ out = zeros( ( x.length + 1 )*2, 'generic' );
+ expected = [ 0, 3, 0, 5, 0, 2, 0, 1 ];
+ actual = array2InsertedAt( x, 2, 5, out, -2, out.length-1 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function copies elements to another array and sets an element at a specified index to a provided value (float64)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = new Float64Array( [ 1.0, 2.0, 3.0 ] );
+
+ out = zeros( x.length + 1, 'float64' );
+ expected = new Float64Array( [ 5.0, 1.0, 2.0, 3.0 ] );
+ actual = array2InsertedAt( x, 0, 5.0, out, 1, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ out = zeros( ( x.length + 1 )*2, 'float64' );
+ expected = new Float64Array( [ 1.0, 0.0, 5.0, 0.0, 2.0, 0.0, 3.0, 0.0 ] );
+ actual = array2InsertedAt( x, 1, 5.0, out, 2, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ out = zeros( ( x.length + 1 )*2, 'float64' );
+ expected = new Float64Array( [ 0.0, 3.0, 0.0, 5.0, 0.0, 2.0, 0.0, 1.0 ] );
+ actual = array2InsertedAt( x, 2, 5.0, out, -2, out.length-1 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function copies elements to another array and sets an element at a specified index to a provided value (int32)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = new Int32Array( [ 1, 2, 3 ] );
+
+ out = zeros( x.length + 1, 'int32' );
+ expected = new Int32Array( [ 5, 1, 2, 3 ] );
+ actual = array2InsertedAt( x, 0, 5, out, 1, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ out = zeros( ( x.length + 1 )*2, 'int32' );
+ expected = new Int32Array( [ 1, 0, 5, 0, 2, 0, 3, 0 ] );
+ actual = array2InsertedAt( x, 1, 5, out, 2, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ out = zeros( ( x.length + 1 )*2, 'int32' );
+ expected = new Int32Array( [ 0, 3, 0, 5, 0, 2, 0, 1 ] );
+ actual = array2InsertedAt( x, 2, 5, out, -2, out.length-1 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function copies elements to another array and sets an element at a specified index to a provided value (complex128)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+
+ out = zeros( x.length + 1, 'complex128' );
+ expected = new Complex128Array( [ 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ actual = array2InsertedAt( x, 0, new Complex128( 7.0, 8.0 ), out, 1, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.strictEqual( isSameComplex128Array( actual, expected ), true, 'returns expected value' );
+
+ out = zeros( ( x.length + 1 )*2, 'complex128' );
+ expected = new Complex128Array( [ 1.0, 2.0, 0.0, 0.0, 7.0, 8.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0, 0.0, 0.0 ] ); // eslint-disable-line max-len
+ actual = array2InsertedAt( x, 1, new Complex128( 7.0, 8.0 ), out, 2, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.strictEqual( isSameComplex128Array( actual, expected ), true, 'returns expected value' );
+
+ out = zeros( ( x.length + 1 )*2, 'complex128' );
+ expected = new Complex128Array( [ 0.0, 0.0, 5.0, 6.0, 0.0, 0.0, 7.0, 8.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 1.0, 2.0 ] ); // eslint-disable-line max-len
+ actual = array2InsertedAt( x, 2, new Complex128( 7.0, 8.0 ), out, -2, out.length-1 ); // eslint-disable-line max-len
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.strictEqual( isSameComplex128Array( actual, expected ), true, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function copies elements to another array and sets an element at a specified index to a provided value (bool)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = new BooleanArray( [ 0, 0, 1, 1 ] );
+
+ out = new BooleanArray( x.length + 1 );
+ expected = new BooleanArray( [ 1, 0, 0, 1, 1 ] );
+ actual = array2InsertedAt( x, 0, true, out, 1, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.strictEqual( isSameBooleanArray( actual, expected ), true, 'returns expected value' );
+
+ out = new BooleanArray( ( x.length + 1 )*2 );
+ expected = new BooleanArray( [ 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 ] );
+ actual = array2InsertedAt( x, 1, true, out, 2, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.strictEqual( isSameBooleanArray( actual, expected ), true, 'returns expected value' );
+
+ out = new BooleanArray( ( x.length + 1 )*2 );
+ expected = new BooleanArray( [ 0, 1, 0, 1, 0, 0, 0, 0, 0, 0 ] );
+ actual = array2InsertedAt( x, 2, false, out, -2, out.length-1 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.strictEqual( isSameBooleanArray( actual, expected ), true, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function copies elements to another array and sets an element at a specified index to a provided value (accessors)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = new AccessorArray( [ 1, 2, 3 ] );
+
+ out = new AccessorArray( zeros( x.length + 1, 'generic' ) );
+ expected = [ 5, 1, 2, 3 ];
+ actual = array2InsertedAt( x, 0, 5, out, 1, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ isEqual( actual, expected );
+
+ out = new AccessorArray( zeros( ( x.length + 1 )*2, 'generic' ) );
+ expected = [ 1, 0, 5, 0, 2, 0, 3, 0 ];
+ actual = array2InsertedAt( x, 1, 5, out, 2, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ isEqual( actual, expected );
+
+ out = new AccessorArray( zeros( ( x.length + 1 )*2, 'generic' ) );
+ expected = [ 0, 3, 0, 5, 0, 2, 0, 1 ];
+ actual = array2InsertedAt( x, 2, 5, out, -2, out.length-1 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ isEqual( actual, expected );
+
+ t.end();
+
+ function isEqual( actual, expected ) {
+ var i;
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( actual.get( i ), expected[ i ], 'returns expected value' );
+ }
+ }
+});
+
+tape( 'the function copies elements to another array and sets an element at a specified index to a provided value (array-like)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = {
+ 'length': 3,
+ '0': 1,
+ '1': 2,
+ '2': 3
+ };
+
+ out = {
+ 'length': 4,
+ '0': 0,
+ '1': 0,
+ '2': 0,
+ '3': 0
+ };
+ expected = [ 5, 1, 2, 3 ];
+ actual = array2InsertedAt( x, 0, 5, out, 1, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ isEqual( actual, expected );
+
+ out = {
+ 'length': 8,
+ '0': 0,
+ '1': 0,
+ '2': 0,
+ '3': 0,
+ '4': 0,
+ '5': 0,
+ '6': 0,
+ '7': 0
+ };
+ expected = [ 1, 0, 5, 0, 2, 0, 3, 0 ];
+ actual = array2InsertedAt( x, 1, 5, out, 2, 0 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ isEqual( actual, expected );
+
+ out = {
+ 'length': 8,
+ '0': 0,
+ '1': 0,
+ '2': 0,
+ '3': 0,
+ '4': 0,
+ '5': 0,
+ '6': 0,
+ '7': 0
+ };
+ expected = [ 0, 3, 0, 5, 0, 2, 0, 1 ];
+ actual = array2InsertedAt( x, 2, 5, out, -2, out.length-1 );
+
+ t.strictEqual( actual, out, 'returns expected value' );
+ isEqual( actual, expected );
+
+ t.end();
+
+ function isEqual( actual, expected ) {
+ var i;
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
+ }
+ }
+});
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/test/test.js b/lib/node_modules/@stdlib/array/base/to-inserted-at/test/test.js
new file mode 100644
index 000000000000..2fce6b87715f
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/test/test.js
@@ -0,0 +1,41 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var hasOwnProp = require( '@stdlib/assert/has-own-property' );
+var hasMethod = require( '@stdlib/assert/is-method' );
+var array2InsertedAt = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof array2InsertedAt, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'attached to the main export is an `assign` method', function test( t ) {
+ t.strictEqual( hasOwnProp( array2InsertedAt, 'assign' ), true, 'returns expected value' );
+ t.strictEqual( hasMethod( array2InsertedAt, 'assign' ), true, 'returns expected value' );
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/array/base/to-inserted-at/test/test.main.js b/lib/node_modules/@stdlib/array/base/to-inserted-at/test/test.main.js
new file mode 100644
index 000000000000..284df2a6165e
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/to-inserted-at/test/test.main.js
@@ -0,0 +1,401 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var Int32Array = require( '@stdlib/array/int32' );
+var Float64Array = require( '@stdlib/array/float64' );
+var Complex128Array = require( '@stdlib/array/complex128' );
+var AccessorArray = require( '@stdlib/array/base/accessor' );
+var Complex128 = require( '@stdlib/complex/float64/ctor' );
+var isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' );
+var isArray = require( '@stdlib/assert/is-array' );
+var isFloat64Array = require( '@stdlib/assert/is-float64array' );
+var isInt32Array = require( '@stdlib/assert/is-int32array' );
+var isComplex128Array = require( '@stdlib/assert/is-complex128array' );
+var array2InsertedAt = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof array2InsertedAt, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function throws an error if provided a second argument which is out-of-bounds (generic)', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ x = [ 1, 2, 3 ];
+
+ values = [
+ 10,
+ 100,
+ 1000,
+ -10,
+ -100,
+ -1000
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ array2InsertedAt( x, value, 0 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is out-of-bounds (float64)', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ x = new Float64Array( [ 1.0, 2.0, 3.0 ] );
+
+ values = [
+ 10,
+ 100,
+ 1000,
+ -10,
+ -100,
+ -1000
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ array2InsertedAt( x, value, 0.0 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is out-of-bounds (int32)', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ x = new Int32Array( [ 1, 2, 3 ] );
+
+ values = [
+ 10,
+ 100,
+ 1000,
+ -10,
+ -100,
+ -1000
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ array2InsertedAt( x, value, 0 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is out-of-bounds (complex128)', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+
+ values = [
+ 10,
+ 100,
+ 1000,
+ -10,
+ -100,
+ -1000
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ array2InsertedAt( x, value, new Complex128( 0.0, 0.0 ) );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is out-of-bounds (accessors)', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ x = new AccessorArray( [ 1, 2, 3 ] );
+
+ values = [
+ 10,
+ 100,
+ 1000,
+ -10,
+ -100,
+ -1000
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ array2InsertedAt( x, value, 0 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided a second argument which is out-of-bounds (array-like)', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ x = {
+ 'length': 3,
+ '0': 1,
+ '1': 2,
+ '2': 3
+ };
+
+ values = [
+ 10,
+ 100,
+ 1000,
+ -10,
+ -100,
+ -1000
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ array2InsertedAt( x, value, 0 );
+ };
+ }
+});
+
+tape( 'the function returns a new array with an element at a specified index containing a provided value (generic)', function test( t ) {
+ var expected;
+ var actual;
+ var x;
+
+ x = [ 1, 2, 3 ];
+
+ expected = [ 5, 1, 2, 3 ];
+ actual = array2InsertedAt( x, 0, 5 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isArray( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 5, 2, 3 ];
+ actual = array2InsertedAt( x, 1, 5 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isArray( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 2, 5, 3 ];
+ actual = array2InsertedAt( x, 2, 5 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isArray( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns a new array with an element at a specified index containing a provided value (float64)', function test( t ) {
+ var expected;
+ var actual;
+ var x;
+
+ x = new Float64Array( [ 1.0, 2.0, 3.0 ] );
+
+ expected = [ 5.0, 1.0, 2.0, 3.0 ];
+ actual = array2InsertedAt( x, 0, 5.0 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isFloat64Array( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1.0, 5.0, 2.0, 3.0 ];
+ actual = array2InsertedAt( x, 1, 5.0 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isFloat64Array( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1.0, 2.0, 5.0, 3.0 ];
+ actual = array2InsertedAt( x, 2, 5.0 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isFloat64Array( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns a new array with an element at a specified index containing a provided value (int32)', function test( t ) {
+ var expected;
+ var actual;
+ var x;
+
+ x = new Int32Array( [ 1, 2, 3 ] );
+
+ expected = new Int32Array( [ 5, 1, 2, 3 ] );
+ actual = array2InsertedAt( x, 0, 5 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isInt32Array( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Int32Array( [ 1, 5, 2, 3 ] );
+ actual = array2InsertedAt( x, 1, 5 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isInt32Array( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Int32Array( [ 1, 2, 5, 3 ] );
+ actual = array2InsertedAt( x, 2, 5 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isInt32Array( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns a new array with an element at a specified index containing a provided value (complex128)', function test( t ) {
+ var expected;
+ var actual;
+ var x;
+
+ x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+
+ expected = new Complex128Array( [ 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ actual = array2InsertedAt( x, 0, new Complex128( 7.0, 8.0 ) );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isComplex128Array( actual ), true, 'returns expected value' );
+ t.strictEqual( isSameComplex128Array( actual, expected ), true, 'returns expected value' );
+
+ expected = new Complex128Array( [ 1.0, 2.0, 7.0, 8.0, 3.0, 4.0, 5.0, 6.0 ] );
+ actual = array2InsertedAt( x, 1, new Complex128( 7.0, 8.0 ) );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isComplex128Array( actual ), true, 'returns expected value' );
+ t.strictEqual( isSameComplex128Array( actual, expected ), true, 'returns expected value' );
+
+ expected = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 7.0, 8.0, 5.0, 6.0 ] );
+ actual = array2InsertedAt( x, 2, new Complex128( 7.0, 8.0 ) );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isComplex128Array( actual ), true, 'returns expected value' );
+ t.strictEqual( isSameComplex128Array( actual, expected ), true, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns a new array with an element at a specified index containing a provided value (accessors)', function test( t ) {
+ var expected;
+ var actual;
+ var x;
+
+ x = new AccessorArray( [ 1, 2, 3 ] );
+
+ expected = [ 5, 1, 2, 3 ];
+ actual = array2InsertedAt( x, 0, 5 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isArray( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 5, 2, 3 ];
+ actual = array2InsertedAt( x, 1, 5 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isArray( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 2, 5, 3 ];
+ actual = array2InsertedAt( x, 2, 5 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isArray( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns a new array with an element at a specified index containing a provided value (array-like)', function test( t ) {
+ var expected;
+ var actual;
+ var x;
+
+ x = {
+ 'length': 3,
+ '0': 1,
+ '1': 2,
+ '2': 3
+ };
+
+ expected = [ 5, 1, 2, 3 ];
+ actual = array2InsertedAt( x, 0, 5 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isArray( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 5, 2, 3 ];
+ actual = array2InsertedAt( x, 1, 5 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isArray( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 2, 5, 3 ];
+ actual = array2InsertedAt( x, 2, 5 );
+
+ t.notEqual( actual, x, 'returns different reference' );
+ t.strictEqual( isArray( actual ), true, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});