diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/README.md b/lib/node_modules/@stdlib/array/base/flatten3d-by/README.md
new file mode 100644
index 00000000000..d61670b91df
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/README.md
@@ -0,0 +1,198 @@
+
+
+
+
+# flatten3dBy
+
+> Flatten a three-dimensional nested array according to a callback function.
+
+
+
+## Usage
+
+```javascript
+var flatten3dBy = require( '@stdlib/array/base/flatten3d-by' );
+```
+
+#### flatten3dBy( x, shape, colexicographic, clbk\[, thisArg] )
+
+Flattens a three-dimensional nested array according to a callback function.
+
+```javascript
+function scale( v ) {
+ return v * 2;
+}
+
+var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+
+var out = flatten3dBy( x, [ 2, 1, 2 ], false, scale );
+// returns [ 2, 4, 6, 8 ]
+```
+
+To flatten in colexicographic order, provide a third argument equal to `true`.
+
+```javascript
+function scale( v ) {
+ return v * 2;
+}
+
+var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+
+var out = flatten3dBy( x, [ 2, 1, 2 ], true, scale );
+// returns [ 2, 6, 4, 8 ]
+```
+
+To set the callback execution context, provide a `thisArg` argument.
+
+
+
+```javascript
+function scale( v ) {
+ this.count += 1;
+ return v * 2;
+}
+
+var x = [ [ [ 1, 2 ], [ 3, 4 ] ] ];
+var ctx = {
+ 'count': 0
+};
+
+var out = flatten3dBy( x, [ 1, 2, 2 ], false, scale, ctx );
+// returns [ 2, 4, 6, 8 ]
+
+var count = ctx.count;
+// returns 4
+```
+
+#### flatten3dBy.assign( x, shape, colexicographic, out, stride, offset, clbk\[, thisArg] )
+
+Flattens a three-dimensional nested array according to a callback function and assigns elements to a provided output array.
+
+```javascript
+var Float64Array = require( '@stdlib/array/float64' );
+
+function scale( v ) {
+ return v * 2;
+}
+
+var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+var out = new Float64Array( 4 );
+
+var y = flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, scale );
+// returns [ 1, 2, 3, 4 ]
+
+var bool = ( y === out );
+// returns true
+
+y = flatten3dBy.assign( x, [ 2, 1, 2 ], true, out, 1, 0, scale );
+// returns [ 1, 3, 2, 4 ]
+```
+
+
+
+
+
+
+
+## Notes
+
+- A callback function is provided the following arguments:
+
+ - **value**: nested array element.
+ - **indices**: element indices (in lexicographic order).
+ - **arr**: the input array.
+
+- Both functions assume that all nested arrays have the same length (i.e., the input array is **not** a ragged array).
+
+
+
+
+
+
+
+## Examples
+
+
+
+```javascript
+var naryFunction = require( '@stdlib/utils/nary-function' );
+var abs = require( '@stdlib/math/base/special/abs' );
+var flatten3dBy = require( '@stdlib/array/base/flatten3d-by' );
+
+var fcn = naryFunction( abs, 1 );
+
+var x = [
+ [ [ -1, -2 ], [ -3, -4 ] ],
+ [ [ -5, -6 ], [ -7, -8 ] ],
+ [ [ -9, -10 ], [ -11, -12 ] ],
+ [ [ -13, -14 ], [ -15, -16 ] ]
+];
+
+var out = flatten3dBy( x, [ 0, 0, 0 ], false, fcn );
+// returns []
+
+out = flatten3dBy( x, [ 0, 0, 0 ], true, fcn );
+// returns []
+
+out = flatten3dBy( x, [ 1, 1, 1 ], false, fcn );
+// returns [ 1 ]
+
+out = flatten3dBy( x, [ 1, 1, 1 ], true, fcn );
+// returns [ 1 ]
+
+out = flatten3dBy( x, [ 2, 2, 2 ], false, fcn );
+// returns [ 1, 2, 3, 4, 5, 6, 7, 8 ]
+
+out = flatten3dBy( x, [ 2, 2, 2 ], true, fcn );
+// returns [ 1, 5, 3, 7, 2, 6, 4, 8 ]
+
+out = flatten3dBy( x, [ 3, 2, 2 ], false, fcn );
+// returns [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
+
+out = flatten3dBy( x, [ 3, 2, 2 ], true, fcn );
+// returns [ 1, 5, 9, 3, 7, 11, 2, 6, 10, 4, 8, 12 ]
+
+out = flatten3dBy( x, [ 4, 2, 2 ], false, fcn );
+// returns [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]
+
+out = flatten3dBy( x, [ 4, 2, 2 ], true, fcn );
+// returns [ 1, 5, 9, 13, 3, 7, 11, 15, 2, 6, 10, 14, 4, 8, 12, 16 ]
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/benchmark/benchmark.js b/lib/node_modules/@stdlib/array/base/flatten3d-by/benchmark/benchmark.js
new file mode 100644
index 00000000000..30930dadfb9
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/benchmark/benchmark.js
@@ -0,0 +1,143 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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 isArray = require( '@stdlib/assert/is-array' );
+var isFloat64Array = require( '@stdlib/assert/is-float64array' );
+var zeroTo = require( '@stdlib/array/base/zero-to' );
+var filled = require( '@stdlib/array/base/filled' );
+var Float64Array = require( '@stdlib/array/float64' );
+var pkg = require( './../package.json' ).name;
+var flatten3dBy = require( './../lib' );
+
+
+// FUNCTIONS //
+
+/**
+* Scales an input value.
+*
+* @private
+* @param {number} v - input value
+* @returns {number} output value
+*
+* @example
+* var v = scale( 2.0 );
+* // returns 4.0
+*/
+function scale( v ) {
+ return v * 2.0;
+}
+
+
+// MAIN //
+
+bench( pkg+':size=125,lexicographic', function benchmark( b ) {
+ var x;
+ var i;
+ var v;
+
+ x = filled( filled( zeroTo( 5 ), 5 ), 5 );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = flatten3dBy( x, [ 5, 5, 5 ], false, scale );
+ 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();
+});
+
+bench( pkg+':size=125,colexicographic', function benchmark( b ) {
+ var x;
+ var i;
+ var v;
+
+ x = filled( filled( zeroTo( 5 ), 5 ), 5 );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = flatten3dBy( x, [ 5, 5, 5 ], true, scale );
+ 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();
+});
+
+bench( pkg+':assign:size=125,lexicographic', function benchmark( b ) {
+ var out;
+ var x;
+ var i;
+ var v;
+
+ out = new Float64Array( 125 );
+ x = filled( filled( zeroTo( 5 ), 5 ), 5 );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = flatten3dBy.assign( x, [ 5, 5, 5 ], false, out, 1, 0, scale );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return a Float64Array' );
+ }
+ }
+ b.toc();
+ if ( !isFloat64Array( v ) ) {
+ b.fail( 'should return a Float64Array' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+':assign:size=125,colexicographic', function benchmark( b ) {
+ var out;
+ var x;
+ var i;
+ var v;
+
+ out = new Float64Array( 125 );
+ x = filled( filled( zeroTo( 5 ), 5 ), 5 );
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = flatten3dBy.assign( x, [ 5, 5, 5 ], true, out, 1, 0, scale );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return a Float64Array' );
+ }
+ }
+ b.toc();
+ if ( !isFloat64Array( v ) ) {
+ b.fail( 'should return a Float64Array' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/docs/repl.txt b/lib/node_modules/@stdlib/array/base/flatten3d-by/docs/repl.txt
new file mode 100644
index 00000000000..2217752e735
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/docs/repl.txt
@@ -0,0 +1,106 @@
+
+{{alias}}( x, shape, colex, clbk[, thisArg] )
+ Flattens a three-dimensional nested array according to a callback function.
+
+ The function assumes that all nested arrays have the same length (i.e., the
+ input array is *not* a ragged array).
+
+ The callback function is provided the following arguments:
+
+ - value: nested array element.
+ - indices: element indices (in lexicographic order).
+ - arr: the input array.
+
+ Parameters
+ ----------
+ x: ArrayLikeObject
+ Input array.
+
+ shape: Array
+ Array shape.
+
+ colex: boolean
+ Specifies whether to flatten array values in colexicographic order.
+
+ clbk: Function
+ Callback function.
+
+ thisArg: any (optional)
+ Callback execution context.
+
+ Returns
+ -------
+ out: Array
+ Flattened array.
+
+ Examples
+ --------
+ > function fcn( v ) { return v * 2; };
+ > var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+ > var out = {{alias}}( x, [ 2, 1, 2 ], false, fcn )
+ [ 2, 4, 6, 8 ]
+ > out = {{alias}}( x, [ 2, 1, 2 ], true, fcn )
+ [ 2, 6, 4, 8 ]
+
+
+{{alias}}.assign( x, shape, colex, out, stride, offset, clbk[, thisArg] )
+ Flattens a three-dimensional nested array according to a callback function
+ and assigns elements to a provided output array.
+
+ The function assumes that all nested arrays have the same length (i.e., the
+ input array is *not* a ragged array).
+
+ The callback function is provided the following arguments:
+
+ - value: nested array element.
+ - indices: element indices (in lexicographic order).
+ - arr: the input array.
+
+ Parameters
+ ----------
+ x: Array
+ Input array.
+
+ shape: Array
+ Array shape.
+
+ colex: boolean
+ Specifies whether to flatten array values in colexicographic order.
+
+ out: Collection
+ Output array.
+
+ stride: integer
+ Output array stride.
+
+ offset: integer
+ Output array index offset.
+
+ clbk: Function
+ Callback function.
+
+ thisArg: any (optional)
+ Callback execution context.
+
+ Returns
+ -------
+ out: Array
+ Output array.
+
+ Examples
+ --------
+ > function fcn( v ) { return v * 2; };
+ > var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+ > var out = [ 0, 0, 0, 0 ];
+ > var v = {{alias}}.assign( x, [ 2, 1, 2 ], false, out, 1, 0, fcn )
+ [ 2, 4, 6, 8 ]
+ > var bool = ( v === out )
+ true
+ > out = [ 0, 0, 0, 0 ];
+ > {{alias}}.assign( x, [ 2, 1, 2 ], true, out, 1, 0, fcn );
+ > out
+ [ 2, 6, 4, 8 ]
+
+ See Also
+ --------
+
diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/base/flatten3d-by/docs/types/index.d.ts
new file mode 100644
index 00000000000..22982f61ca6
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/docs/types/index.d.ts
@@ -0,0 +1,197 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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 } from '@stdlib/types/object';
+
+/**
+* Three-dimensional nested array.
+*/
+type Array3D = Array>>;
+
+/**
+* Nullary callback function.
+*
+* @returns result
+*/
+type Nullary = () => U;
+
+/**
+* Unary callback function.
+*
+* @param value - array element
+* @returns result
+*/
+type Unary = ( value: T ) => U;
+
+/**
+* Binary callback function.
+*
+* @param value - array element
+* @param indices - element indices
+* @returns result
+*/
+type Binary = ( value: T, indices: Array ) => U;
+
+/**
+* Ternary callback function.
+*
+* @param value - array element
+* @param indices - element indices
+* @param arr - input array
+* @returns result
+*/
+type Ternary = ( value: T, indices: Array, arr: Array3D ) => U;
+
+/**
+* Callback function.
+*
+* @param value - array element
+* @param indices - element indices
+* @param arr - input array
+* @returns result
+*/
+type Callback = Nullary | Unary | Binary | Ternary;
+
+/**
+* Interface describing `flatten3dBy`.
+*/
+interface Flatten3dBy {
+ /**
+ * Flattens a three-dimensional nested array according to a callback function..
+ *
+ * ## Notes
+ *
+ * - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).
+ *
+ * @param x - input array
+ * @param shape - array shape
+ * @param colexicographic - specifies whether to flatten array values in colexicographic order
+ * @param clbk - callback function
+ * @param thisArg - callback execution context
+ * @returns flattened array
+ *
+ * @example
+ * function scale( v ) {
+ * return v * 2;
+ * }
+ *
+ * var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+ *
+ * var out = flatten3dBy( x, [ 2, 1, 2 ], false, scale );
+ * // returns [ 2, 4, 6, 8 ]
+ *
+ * @example
+ * function scale( v ) {
+ * return v * 2;
+ * }
+ *
+ * var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+ *
+ * var out = flatten3dBy( x, [ 2, 1, 2 ], true, scale );
+ * // returns [ 2, 6, 4, 8 ]
+ */
+ ( x: Array3D, shape: Collection, colexicographic: boolean, clbk: Callback, thisArg?: ThisParameterType> ): Array;
+
+ /**
+ * Flattens a three-dimensional nested array according to a callback function and assigns elements to a provided output array.
+ *
+ * ## Notes
+ *
+ * - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).
+ *
+ * @param x - input array
+ * @param shape - array shape
+ * @param colexicographic - specifies whether to flatten array values in colexicographic order
+ * @param out - output array
+ * @param stride - output array stride
+ * @param offset - output array index offset
+ * @param clbk - callback function
+ * @param thisArg - callback execution context
+ * @returns output array
+ *
+ * @example
+ * var Float64Array = require( `@stdlib/array/float64` );
+ *
+ * function scale( v ) {
+ * return v * 2;
+ * }
+ *
+ * var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+ *
+ * var out = flatten3dBy.assign( x, [ 2, 1, 2 ], false, new Float64Array( 4 ), 1, 0, scale );
+ * // returns [ 2, 4, 6, 8 ]
+ *
+ * @example
+ * var Float64Array = require( `@stdlib/array/float64` );
+ *
+ * function scale( v ) {
+ * return v * 2;
+ * }
+ *
+ * var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+ *
+ * var out = flatten3dBy.assign( x, [ 2, 1, 2 ], true, new Float64Array( 4 ), 1, 0, scale );
+ * // returns [ 2, 6, 4, 8 ]
+ */
+ assign( x: Array3D, shape: Collection, colexicographic: boolean, out: Collection, stride: number, offset: number, clbk: Callback, thisArg?: ThisParameterType> ): Collection;
+}
+
+/**
+* Flattens a three-dimensional nested array according to a callback function.
+*
+* ## Notes
+*
+* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).
+*
+* @param x - input array
+* @param shape - array shape
+* @param colexicographic - specifies whether to flatten array values in colexicographic order
+* @param clbk - callback function
+* @param thisArg - callback execution context
+* @returns flattened array
+*
+* @example
+* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+*
+* function scale( v ) {
+* return v * 2;
+* }
+*
+* var out = flatten3dBy( x, [ 2, 1, 2 ], false, scale );
+* // returns [ 2, 4, 6, 8 ]
+*
+* @example
+* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+*
+* function scale( v ) {
+* return v * 2;
+* }
+*
+* var out = flatten3dBy( x, [ 2, 1, 2 ], true, scale );
+* // returns [ 2, 6, 4, 8 ]
+*/
+declare var flatten3dBy: Flatten3dBy;
+
+
+// EXPORTS //
+
+export = flatten3dBy;
diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/docs/types/test.ts b/lib/node_modules/@stdlib/array/base/flatten3d-by/docs/types/test.ts
new file mode 100644
index 00000000000..7da978eafbf
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/docs/types/test.ts
@@ -0,0 +1,340 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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 flatten3dBy = require( './index' );
+
+/**
+* Identity function.
+*
+* @param v - input value
+* @returns input value
+*/
+function identity( value: T ): T {
+ return value;
+}
+
+
+// TESTS //
+
+// The function returns an array...
+{
+ const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+
+ flatten3dBy( x, [ 2, 1, 2 ], false, identity ); // $ExpectType number[]
+ flatten3dBy( x, [ 2, 1, 2 ], true, identity ); // $ExpectType number[]
+
+ flatten3dBy( x, [ 2, 1, 2 ], false, identity, {} ); // $ExpectType number[]
+ flatten3dBy( x, [ 2, 1, 2 ], true, identity, {} ); // $ExpectType number[]
+
+ flatten3dBy( [ [ [ '1', '2' ] ], [ [ '3', '4' ] ] ], [ 2, 1, 2 ], false, identity ); // $ExpectType string[]
+ flatten3dBy( [ [ [ '1', '2' ] ], [ [ '3', '4' ] ] ], [ 2, 1, 2 ], true, identity ); // $ExpectType string[]
+
+ flatten3dBy( [ [ [ '1', '2' ] ], [ [ '3', '4' ] ] ], [ 2, 1, 2 ], false, identity, {} ); // $ExpectType string[]
+ flatten3dBy( [ [ [ '1', '2' ] ], [ [ '3', '4' ] ] ], [ 2, 1, 2 ], true, identity, {} ); // $ExpectType string[]
+}
+
+// The compiler throws an error if the function is provided a first argument which is not an array-like object...
+{
+ flatten3dBy( 1, [ 2, 1, 2 ], false, identity ); // $ExpectError
+ flatten3dBy( true, [ 2, 1, 2 ], false, identity ); // $ExpectError
+ flatten3dBy( false, [ 2, 1, 2 ], false, identity ); // $ExpectError
+ flatten3dBy( null, [ 2, 1, 2 ], false, identity ); // $ExpectError
+ flatten3dBy( void 0, [ 2, 1, 2 ], false, identity ); // $ExpectError
+ flatten3dBy( {}, [ 2, 1, 2 ], false, identity ); // $ExpectError
+
+ flatten3dBy( 1, [ 2, 1, 2 ], false, identity, {} ); // $ExpectError
+ flatten3dBy( true, [ 2, 1, 2 ], false, identity, {} ); // $ExpectError
+ flatten3dBy( false, [ 2, 1, 2 ], false, identity, {} ); // $ExpectError
+ flatten3dBy( null, [ 2, 1, 2 ], false, identity, {} ); // $ExpectError
+ flatten3dBy( void 0, [ 2, 1, 2 ], false, identity, {} ); // $ExpectError
+ flatten3dBy( {}, [ 2, 1, 2 ], false, identity, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a second argument which is not an array-like object containing numbers...
+{
+ const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+
+ flatten3dBy( x, '', false, identity ); // $ExpectError
+ flatten3dBy( x, 1, false, identity ); // $ExpectError
+ flatten3dBy( x, true, false, identity ); // $ExpectError
+ flatten3dBy( x, false, false, identity ); // $ExpectError
+ flatten3dBy( x, null, false, identity ); // $ExpectError
+ flatten3dBy( x, void 0, false, identity ); // $ExpectError
+ flatten3dBy( x, {}, false, identity ); // $ExpectError
+ flatten3dBy( x, [ 1, '2', 3 ], false, identity ); // $ExpectError
+ flatten3dBy( x, ( x: number ): number => x, false, identity ); // $ExpectError
+
+ flatten3dBy( x, '', false, identity, {} ); // $ExpectError
+ flatten3dBy( x, 1, false, identity, {} ); // $ExpectError
+ flatten3dBy( x, true, false, identity, {} ); // $ExpectError
+ flatten3dBy( x, false, false, identity, {} ); // $ExpectError
+ flatten3dBy( x, null, false, identity, {} ); // $ExpectError
+ flatten3dBy( x, void 0, false, identity, {} ); // $ExpectError
+ flatten3dBy( x, {}, false, identity, {} ); // $ExpectError
+ flatten3dBy( x, [ 1, '2', 3 ], false, identity, {} ); // $ExpectError
+ flatten3dBy( x, ( x: number ): number => x, false, identity, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a third argument which is not a boolean...
+{
+ const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+
+ flatten3dBy( x, [ 2, 1, 2 ], '', identity ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], 1, identity ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], null, identity ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], void 0, identity ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], {}, identity ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], [], identity ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], ( x: number ): number => x, identity ); // $ExpectError
+
+ flatten3dBy( x, [ 2, 1, 2 ], '', identity, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], 1, identity, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], null, identity, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], void 0, identity, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], {}, identity, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], [], identity, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], ( x: number ): number => x, identity, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a fourth argument which is not a function...
+{
+ const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+
+ flatten3dBy( x, [ 2, 1, 2 ], false, '' ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, 1 ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, true ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, false ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, null ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, void 0 ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, [] ); // $ExpectError
+
+ flatten3dBy( x, [ 2, 1, 2 ], false, '', {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, 1, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, true, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, false, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, null, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, void 0, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, {}, {} ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, [], {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+
+ flatten3dBy(); // $ExpectError
+ flatten3dBy( x ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ] ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false ); // $ExpectError
+ flatten3dBy( x, [ 2, 1, 2 ], false, identity, {}, {} ); // $ExpectError
+}
+
+// Attached to the main export is an `assign` method which returns a collection...
+{
+ const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+
+ const out1 = [ 0, 0, 0, 0 ];
+
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out1, 1, 0, identity ); // $ExpectType Collection
+ flatten3dBy.assign( x, [ 2, 1, 2 ], true, out1, 1, 0, identity ); // $ExpectType Collection
+
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out1, 1, 0, identity, {} ); // $ExpectType Collection
+ flatten3dBy.assign( x, [ 2, 1, 2 ], true, out1, 1, 0, identity, {} ); // $ExpectType Collection
+
+ const out2 = [ '', '', '', '' ];
+
+ flatten3dBy.assign( [ [ [ '1', '2' ] ], [ [ '3', '4' ] ] ], [ 2, 1, 2 ], false, out2, 1, 0, identity ); // $ExpectType Collection
+ flatten3dBy.assign( [ [ [ '1', '2' ] ], [ [ '3', '4' ] ] ], [ 2, 1, 2 ], true, out2, 1, 0, identity ); // $ExpectType Collection
+
+ flatten3dBy.assign( [ [ [ '1', '2' ] ], [ [ '3', '4' ] ] ], [ 2, 1, 2 ], false, out2, 1, 0, identity, {} ); // $ExpectType Collection
+ flatten3dBy.assign( [ [ [ '1', '2' ] ], [ [ '3', '4' ] ] ], [ 2, 1, 2 ], true, out2, 1, 0, identity, {} ); // $ExpectType Collection
+}
+
+// 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 ];
+
+ flatten3dBy.assign( 1, [ 2, 1, 2 ], false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( true, [ 2, 1, 2 ], false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( false, [ 2, 1, 2 ], false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( null, [ 2, 1, 2 ], false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( void 0, [ 2, 1, 2 ], false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( {}, [ 2, 1, 2 ], false, out, 1, 0, identity ); // $ExpectError
+
+ flatten3dBy.assign( 1, [ 2, 1, 2 ], false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( true, [ 2, 1, 2 ], false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( false, [ 2, 1, 2 ], false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( null, [ 2, 1, 2 ], false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( void 0, [ 2, 1, 2 ], false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( {}, [ 2, 1, 2 ], false, out, 1, 0, identity, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided a second argument which is not an array-like object containing numbers...
+{
+ const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+ const out = [ 0, 0, 0, 0 ];
+
+ flatten3dBy.assign( x, '', false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, 1, false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, true, false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, false, false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, null, false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, void 0, false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, {}, false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 1, '2', 3 ], false, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, ( x: number ): number => x, false, out, 1, 0, identity ); // $ExpectError
+
+ flatten3dBy.assign( x, '', false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, 1, false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, true, false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, false, false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, null, false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, void 0, false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, {}, false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 1, '2', 3 ], false, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, ( x: number ): number => x, false, out, 1, 0, identity, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided a third argument which is not a boolean...
+{
+ const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+ const out = [ 0, 0, 0, 0 ];
+
+ flatten3dBy.assign( x, [ 2, 1, 2 ], '', out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], 1, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], null, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], void 0, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], {}, out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], [], out, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], ( x: number ): number => x, out, 1, 0, identity ); // $ExpectError
+
+ flatten3dBy.assign( x, [ 2, 1, 2 ], '', out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], 1, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], null, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], void 0, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], {}, out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], [], out, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], ( x: number ): number => x, out, 1, 0, identity, {} ); // $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 ] ] ];
+
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, 1, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, true, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, false, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, null, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, void 0, 1, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, {}, 1, 0, identity ); // $ExpectError
+
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, 1, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, true, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, false, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, null, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, void 0, 1, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, {}, 1, 0, identity, {} ); // $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 ];
+
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, '1', 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, true, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, false, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, null, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, void 0, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, {}, 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, [], 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, ( x: number ): number => x, 0, identity ); // $ExpectError
+
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, '1', 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, true, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, false, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, null, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, void 0, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, {}, 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, [], 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, ( x: number ): number => x, 0, identity, {} ); // $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 ];
+
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, '1', identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, true, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, false, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, null, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, void 0, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, {}, identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, [], identity ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, ( x: number ): number => x, identity ); // $ExpectError
+
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, '1', identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, true, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, false, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, null, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, void 0, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, {}, identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, [], identity, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, ( x: number ): number => x, identity, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided a seventh argument which is not a function...
+{
+ const x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+ const out = [ 0, 0, 0, 0 ];
+
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, '1' ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, 1 ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, true ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, false ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, null ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, void 0 ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, [] ); // $ExpectError
+
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, '1', {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, 1, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, true, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, false, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, null, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, void 0, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, {}, {} ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, [], {} ); // $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 ];
+
+ flatten3dBy.assign(); // $ExpectError
+ flatten3dBy.assign( x ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ] ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1 ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0 ); // $ExpectError
+ flatten3dBy.assign( x, [ 2, 1, 2 ], false, out, 1, 0, identity, {}, {} ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/examples/index.js b/lib/node_modules/@stdlib/array/base/flatten3d-by/examples/index.js
new file mode 100644
index 00000000000..0ecbe47e15c
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/examples/index.js
@@ -0,0 +1,72 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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 naryFunction = require( '@stdlib/utils/nary-function' );
+var abs = require( '@stdlib/math/base/special/abs' );
+var flatten3dBy = require( './../lib' );
+
+var fcn = naryFunction( abs, 1 );
+
+var x = [
+ [ [ -1, -2 ], [ -3, -4 ] ],
+ [ [ -5, -6 ], [ -7, -8 ] ],
+ [ [ -9, -10 ], [ -11, -12 ] ],
+ [ [ -13, -14 ], [ -15, -16 ] ]
+];
+
+var out = flatten3dBy( x, [ 0, 0, 0 ], false, fcn );
+console.log( out );
+// => []
+
+out = flatten3dBy( x, [ 0, 0, 0 ], true, fcn );
+console.log( out );
+// => []
+
+out = flatten3dBy( x, [ 1, 1, 1 ], false, fcn );
+console.log( out );
+// => [ 1 ]
+
+out = flatten3dBy( x, [ 1, 1, 1 ], true, fcn );
+console.log( out );
+// => [ 1 ]
+
+out = flatten3dBy( x, [ 2, 2, 2 ], false, fcn );
+console.log( out );
+// => [ 1, 2, 3, 4, 5, 6, 7, 8 ]
+
+out = flatten3dBy( x, [ 2, 2, 2 ], true, fcn );
+console.log( out );
+// => [ 1, 5, 3, 7, 2, 6, 4, 8 ]
+
+out = flatten3dBy( x, [ 3, 2, 2 ], false, fcn );
+console.log( out );
+// => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
+
+out = flatten3dBy( x, [ 3, 2, 2 ], true, fcn );
+console.log( out );
+// => [ 1, 5, 9, 3, 7, 11, 2, 6, 10, 4, 8, 12 ]
+
+out = flatten3dBy( x, [ 4, 2, 2 ], false, fcn );
+console.log( out );
+// => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]
+
+out = flatten3dBy( x, [ 4, 2, 2 ], true, fcn );
+console.log( out );
+// => [ 1, 5, 9, 13, 3, 7, 11, 15, 2, 6, 10, 14, 4, 8, 12, 16 ]
diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/lib/assign.js b/lib/node_modules/@stdlib/array/base/flatten3d-by/lib/assign.js
new file mode 100644
index 00000000000..d011edf51c0
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/lib/assign.js
@@ -0,0 +1,111 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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-len */
+
+'use strict';
+
+// MAIN //
+
+/**
+* Flattens a three-dimensional nested array according to a callback function and assigns elements to a provided output array.
+*
+* ## Notes
+*
+* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).
+*
+* @param {Array>} x - input nested array
+* @param {NonNegativeIntegerArray} shape - array shape
+* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order
+* @param {Collection} out - output array
+* @param {integer} stride - output array stride
+* @param {NonNegativeInteger} offset - output array index offset
+* @param {Function} clbk - callback function
+* @param {*} [thisArg] - callback execution context
+* @returns {Collection} output array
+*
+* @example
+* var Float64Array = require( '@stdlib/array/float64' );
+*
+* function scale( v ) {
+* return v * 2;
+* }
+*
+* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+*
+* var out = flatten3dBy( x, [ 2, 1, 2 ], false, new Float64Array( 4 ), 1, 0, scale );
+* // returns [ 2, 4, 6, 8 ]
+*
+* @example
+* var Float64Array = require( '@stdlib/array/float64' );
+*
+* function scale( v ) {
+* return v * 2;
+* }
+*
+* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+*
+* var out = flatten3dBy( x, [ 2, 1, 2 ], true, new Float64Array( 4 ), 1, 0, scale );
+* // returns [ 2, 6, 4, 8 ]
+*/
+function flatten3dBy( x, shape, colexicographic, out, stride, offset, clbk, thisArg ) {
+ var S0;
+ var S1;
+ var S2;
+ var i0;
+ var i1;
+ var i2;
+ var a0;
+ var a1;
+ var io;
+
+ // Extract loop variables:
+ S0 = shape[ 2 ]; // for nested arrays, the last dimensions have the fastest changing indices
+ S1 = shape[ 1 ];
+ S2 = shape[ 0 ];
+
+ // Iterate over the array dimensions...
+ io = offset;
+ if ( colexicographic ) {
+ for ( i0 = 0; i0 < S0; i0++ ) {
+ for ( i1 = 0; i1 < S1; i1++ ) {
+ for ( i2 = 0; i2 < S2; i2++ ) {
+ out[ io ] = clbk.call( thisArg, x[ i2 ][ i1 ][ i0 ], [ i2, i1, i0 ], x ); // equivalent to storing in column-major (Fortran-style) order
+ io += stride;
+ }
+ }
+ }
+ return out;
+ }
+ for ( i2 = 0; i2 < S2; i2++ ) {
+ a1 = x[ i2 ];
+ for ( i1 = 0; i1 < S1; i1++ ) {
+ a0 = a1[ i1 ];
+ for ( i0 = 0; i0 < S0; i0++ ) {
+ out[ io ] = clbk.call( thisArg, a0[ i0 ], [ i2, i1, i0 ], x ); // equivalent to storing in row-major (C-style) order
+ io += stride;
+ }
+ }
+ }
+ return out;
+}
+
+
+// EXPORTS //
+
+module.exports = flatten3dBy;
diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/lib/index.js b/lib/node_modules/@stdlib/array/base/flatten3d-by/lib/index.js
new file mode 100644
index 00000000000..533dad0052f
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/lib/index.js
@@ -0,0 +1,81 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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';
+
+/**
+* Flatten a three-dimensional nested array according to a callback function.
+*
+* @module @stdlib/array/base/flatten3d-by
+*
+* @example
+* var flatten3dBy = require( '@stdlib/array/base/flatten3d-by' );
+*
+* function scale( v ) {
+* return v * 2;
+* }
+*
+* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+*
+* var out = flatten3dBy( x, [ 2, 1, 2 ], false, scale );
+* // returns [ 2, 4, 6, 8 ]
+*
+* @example
+* var flatten3dBy = require( '@stdlib/array/base/flatten3d-by' );
+*
+* function scale( v ) {
+* return v * 2;
+* }
+*
+* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+*
+* var out = flatten3dBy( x, [ 2, 1, 2 ], true, scale );
+* // returns [ 2, 6, 4, 8 ]
+*
+* @example
+* var Float64Array = require( '@stdlib/array/float64' );
+* var flatten3dBy = require( '@stdlib/array/base/flatten3d-by' );
+*
+* function scale( v ) {
+* return v * 2;
+* }
+*
+* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+*
+* var out = new Float64Array( 4 );
+* var y = flatten3dBy.assign( x, [ 2, 1, 2 ], true, out, 1, 0, scale );
+* // returns [ 2, 6, 4, 8 ]
+*
+* var bool = ( y === out );
+*/
+
+// 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/flatten3d-by/lib/main.js b/lib/node_modules/@stdlib/array/base/flatten3d-by/lib/main.js
new file mode 100644
index 00000000000..96424c26636
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/lib/main.js
@@ -0,0 +1,104 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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-len */
+
+'use strict';
+
+// MAIN //
+
+/**
+* Flattens a three-dimensional nested array according to a callback function.
+*
+* ## Notes
+*
+* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).
+*
+* @param {Array>} x - input nested array
+* @param {NonNegativeIntegerArray} shape - array shape
+* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order
+* @param {Function} clbk - callback function
+* @param {*} [thisArg] - callback execution context
+* @returns {Array} flattened array
+*
+* @example
+* function scale( v ) {
+* return v * 2;
+* }
+*
+* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+*
+* var out = flatten3dBy( x, [ 2, 1, 2 ], false, scale );
+* // returns [ 2, 4, 6, 8 ]
+*
+* @example
+* function scale( v ) {
+* return v * 2;
+* }
+*
+* var x = [ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ];
+*
+* var out = flatten3dBy( x, [ 2, 1, 2 ], true, scale );
+* // returns [ 2, 6, 4, 8 ]
+*/
+function flatten3dBy( x, shape, colexicographic, clbk, thisArg ) {
+ var out;
+ var S0;
+ var S1;
+ var S2;
+ var i0;
+ var i1;
+ var i2;
+ var a0;
+ var a1;
+
+ // Extract loop variables:
+ S0 = shape[ 2 ]; // for nested arrays, the last dimensions have the fastest changing indices
+ S1 = shape[ 1 ];
+ S2 = shape[ 0 ];
+
+ // Initialize an output array:
+ out = [];
+
+ // Iterate over the array dimensions...
+ if ( colexicographic ) {
+ for ( i0 = 0; i0 < S0; i0++ ) {
+ for ( i1 = 0; i1 < S1; i1++ ) {
+ for ( i2 = 0; i2 < S2; i2++ ) {
+ out.push( clbk.call( thisArg, x[ i2 ][ i1 ][ i0 ], [ i2, i1, i0 ], x ) ); // equivalent to storing in column-major (Fortran-style) order
+ }
+ }
+ }
+ return out;
+ }
+ for ( i2 = 0; i2 < S2; i2++ ) {
+ a1 = x[ i2 ];
+ for ( i1 = 0; i1 < S1; i1++ ) {
+ a0 = a1[ i1 ];
+ for ( i0 = 0; i0 < S0; i0++ ) {
+ out.push( clbk.call( thisArg, a0[ i0 ], [ i2, i1, i0 ], x ) ); // equivalent to storing in row-major (C-style) order
+ }
+ }
+ }
+ return out;
+}
+
+
+// EXPORTS //
+
+module.exports = flatten3dBy;
diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/package.json b/lib/node_modules/@stdlib/array/base/flatten3d-by/package.json
new file mode 100644
index 00000000000..c7b48dc0bfa
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/package.json
@@ -0,0 +1,70 @@
+{
+ "name": "@stdlib/array/base/flatten3d-by",
+ "version": "0.0.0",
+ "description": "Flatten a three-dimensional nested array according to a callback function.",
+ "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",
+ "utilities",
+ "utils",
+ "generic",
+ "array",
+ "flatten",
+ "flat",
+ "3d",
+ "tensor",
+ "strided",
+ "ndarray",
+ "multidimensional",
+ "foreach",
+ "map",
+ "transform",
+ "callback",
+ "accessor"
+ ]
+}
diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/test/test.assign.js b/lib/node_modules/@stdlib/array/base/flatten3d-by/test/test.assign.js
new file mode 100644
index 00000000000..9722db83ab9
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/test/test.assign.js
@@ -0,0 +1,399 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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 naryFunction = require( '@stdlib/utils/nary-function' );
+var abs = require( '@stdlib/math/base/special/abs' );
+var Float64Array = require( '@stdlib/array/float64' );
+var flatten3dBy = require( './../lib/assign.js' );
+
+
+// VARIABLES //
+
+var clbk = naryFunction( abs, 1 );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof flatten3dBy, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function flattens a nested array (lexicographic)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = [
+ [
+ [ -1, -2 ],
+ [ -3, -4 ]
+ ],
+ [
+ [ -5, -6 ],
+ [ -7, -8 ]
+ ],
+ [
+ [ -9, -10 ],
+ [ -11, -12 ]
+ ],
+ [
+ [ -13, -14 ],
+ [ -15, -16 ]
+ ]
+ ];
+
+ expected = new Float64Array( [] );
+ out = new Float64Array( 0 );
+ actual = flatten3dBy( x, [ 0, 0, 0 ], false, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [] );
+ out = new Float64Array( 0 );
+ actual = flatten3dBy( x, [ 0, 0, 1 ], false, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [] );
+ out = new Float64Array( 0 );
+ actual = flatten3dBy( x, [ 1, 0, 0 ], false, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1 ] );
+ out = new Float64Array( 1 );
+ actual = flatten3dBy( x, [ 1, 1, 1 ], false, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 2 ] );
+ out = new Float64Array( 2 );
+ actual = flatten3dBy( x, [ 1, 1, 2 ], false, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 5 ] );
+ out = new Float64Array( 2 );
+ actual = flatten3dBy( x, [ 2, 1, 1 ], false, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 2, 5, 6 ] );
+ out = new Float64Array( 4 );
+ actual = flatten3dBy( x, [ 2, 1, 2 ], false, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ] );
+ out = new Float64Array( 12 );
+ actual = flatten3dBy( x, [ 3, 2, 2 ], false, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 5, 9, 13 ] );
+ out = new Float64Array( 4 );
+ actual = flatten3dBy( x, [ 4, 1, 1 ], false, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 2, 5, 6, 9, 10, 13, 14 ] );
+ out = new Float64Array( 8 );
+ actual = flatten3dBy( x, [ 4, 1, 2 ], false, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ] ); // eslint-disable-line max-len
+ out = new Float64Array( 16 );
+ actual = flatten3dBy( x, [ 4, 2, 2 ], false, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function flattens a nested array (colexicographic)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = [
+ [
+ [ -1, -2 ],
+ [ -3, -4 ]
+ ],
+ [
+ [ -5, -6 ],
+ [ -7, -8 ]
+ ],
+ [
+ [ -9, -10 ],
+ [ -11, -12 ]
+ ],
+ [
+ [ -13, -14 ],
+ [ -15, -16 ]
+ ]
+ ];
+
+ expected = new Float64Array( [] );
+ out = new Float64Array( 0 );
+ actual = flatten3dBy( x, [ 0, 0, 0 ], true, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [] );
+ out = new Float64Array( 0 );
+ actual = flatten3dBy( x, [ 0, 0, 1 ], true, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [] );
+ out = new Float64Array( 0 );
+ actual = flatten3dBy( x, [ 1, 0, 0 ], true, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1 ] );
+ out = new Float64Array( 1 );
+ actual = flatten3dBy( x, [ 1, 1, 1 ], true, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 2 ] );
+ out = new Float64Array( 2 );
+ actual = flatten3dBy( x, [ 1, 1, 2 ], true, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 5 ] );
+ out = new Float64Array( 2 );
+ actual = flatten3dBy( x, [ 2, 1, 1 ], true, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 5, 2, 6 ] );
+ out = new Float64Array( 4 );
+ actual = flatten3dBy( x, [ 2, 1, 2 ], true, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 5, 9, 3, 7, 11, 2, 6, 10, 4, 8, 12 ] );
+ out = new Float64Array( 12 );
+ actual = flatten3dBy( x, [ 3, 2, 2 ], true, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 5, 9, 13 ] );
+ out = new Float64Array( 4 );
+ actual = flatten3dBy( x, [ 4, 1, 1 ], true, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 5, 9, 13, 2, 6, 10, 14 ] );
+ out = new Float64Array( 8 );
+ actual = flatten3dBy( x, [ 4, 1, 2 ], true, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = new Float64Array( [ 1, 5, 9, 13, 3, 7, 11, 15, 2, 6, 10, 14, 4, 8, 12, 16 ] ); // eslint-disable-line max-len
+ out = new Float64Array( 16 );
+ actual = flatten3dBy( x, [ 4, 2, 2 ], true, out, 1, 0, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports providing a stride (lexicographic)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = [
+ [
+ [ -1, -2 ],
+ [ -3, -4 ]
+ ]
+ ];
+
+ expected = new Float64Array( [ 1, 0, 2, 0, 3, 0, 4, 0 ] );
+ out = new Float64Array( 8 );
+ actual = flatten3dBy( x, [ 1, 2, 2 ], false, out, 2, 0, clbk );
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports providing a stride (colexicographic)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = [
+ [
+ [ -1, -2 ],
+ [ -3, -4 ]
+ ]
+ ];
+
+ expected = new Float64Array( [ 1, 0, 3, 0, 2, 0, 4, 0 ] );
+ out = new Float64Array( 8 );
+ actual = flatten3dBy( x, [ 1, 2, 2 ], true, out, 2, 0, clbk );
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports providing an offset (lexicographic)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = [
+ [
+ [ -1, -2 ],
+ [ -3, -4 ]
+ ]
+ ];
+
+ expected = new Float64Array( [ 0, 0, 1, 2, 3, 4, 0, 0 ] );
+ out = new Float64Array( 8 );
+ actual = flatten3dBy( x, [ 1, 2, 2 ], false, out, 1, 2, clbk );
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports providing an offset (colexicographic)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = [
+ [
+ [ -1, -2 ],
+ [ -3, -4 ]
+ ]
+ ];
+
+ expected = new Float64Array( [ 0, 0, 1, 3, 2, 4, 0, 0 ] );
+ out = new Float64Array( 8 );
+ actual = flatten3dBy( x, [ 1, 2, 2 ], true, out, 1, 2, clbk );
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports complex access patterns (lexicographic)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = [
+ [
+ [ -1, -2 ],
+ [ -3, -4 ]
+ ]
+ ];
+
+ expected = new Float64Array( [ 0, 4, 0, 3, 0, 2, 0, 1 ] );
+ out = new Float64Array( 8 );
+ actual = flatten3dBy( x, [ 1, 2, 2 ], false, out, -2, 7, clbk );
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports complex access patterns (colexicographic)', function test( t ) {
+ var expected;
+ var actual;
+ var out;
+ var x;
+
+ x = [
+ [
+ [ -1, -2 ],
+ [ -3, -4 ]
+ ]
+ ];
+
+ expected = new Float64Array( [ 0, 4, 0, 2, 0, 3, 0, 1 ] );
+ out = new Float64Array( 8 );
+ actual = flatten3dBy( x, [ 1, 2, 2 ], true, out, -2, 7, clbk );
+ t.strictEqual( actual, out, 'returns expected value' );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports setting the callback execution context (lexicographic)', function test( t ) {
+ var ctx;
+ var out;
+ var x;
+
+ x = [
+ [
+ [ -1, -2 ],
+ [ -3, -4 ]
+ ]
+ ];
+
+ ctx = {
+ 'count': 0
+ };
+
+ out = new Float64Array( 4 );
+ flatten3dBy( x, [ 1, 2, 2 ], false, out, 1, 0, fcn, ctx );
+ t.strictEqual( ctx.count, 4, 'returns expected value' );
+
+ t.end();
+
+ function fcn( value, indices, arr ) {
+ this.count += 1; // eslint-disable-line no-invalid-this
+ t.strictEqual( indices.length, 3, 'returns expected value' );
+ t.strictEqual( value, arr[ indices[0] ][ indices[1] ][ indices[2] ], 'returns expected value' );
+ t.strictEqual( arr, x, 'returns expected value' );
+ }
+});
+
+tape( 'the function supports setting the callback execution context (colexicographic)', function test( t ) {
+ var ctx;
+ var out;
+ var x;
+
+ x = [
+ [
+ [ -1, -2 ],
+ [ -3, -4 ]
+ ]
+ ];
+
+ ctx = {
+ 'count': 0
+ };
+
+ out = new Float64Array( 4 );
+ flatten3dBy( x, [ 1, 2, 2 ], true, out, 1, 0, fcn, ctx );
+ t.strictEqual( ctx.count, 4, 'returns expected value' );
+
+ t.end();
+
+ function fcn( value, indices, arr ) {
+ this.count += 1; // eslint-disable-line no-invalid-this
+ t.strictEqual( indices.length, 3, 'returns expected value' );
+ t.strictEqual( value, arr[ indices[0] ][ indices[1] ][ indices[2] ], 'returns expected value' );
+ t.strictEqual( arr, x, 'returns expected value' );
+ }
+});
diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/test/test.js b/lib/node_modules/@stdlib/array/base/flatten3d-by/test/test.js
new file mode 100644
index 00000000000..61622e12646
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/test/test.js
@@ -0,0 +1,40 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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 flatten3dBy = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof flatten3dBy, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'attached to the main export is an `assign` method', function test( t ) {
+ t.strictEqual( hasOwnProp( flatten3dBy, 'assign' ), true, 'has property' );
+ t.strictEqual( typeof flatten3dBy.assign, 'function', 'has method' );
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/array/base/flatten3d-by/test/test.main.js b/lib/node_modules/@stdlib/array/base/flatten3d-by/test/test.main.js
new file mode 100644
index 00000000000..60887abf0fc
--- /dev/null
+++ b/lib/node_modules/@stdlib/array/base/flatten3d-by/test/test.main.js
@@ -0,0 +1,238 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2023 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 naryFunction = require( '@stdlib/utils/nary-function' );
+var abs = require( '@stdlib/math/base/special/abs' );
+var flatten3dBy = require( './../lib/main.js' );
+
+
+// VARIABLES //
+
+var clbk = naryFunction( abs, 1 );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof flatten3dBy, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function flattens a nested array (lexicographic)', function test( t ) {
+ var expected;
+ var actual;
+ var x;
+
+ x = [
+ [
+ [ -1, -2 ],
+ [ -3, -4 ]
+ ],
+ [
+ [ -5, -6 ],
+ [ -7, -8 ]
+ ],
+ [
+ [ -9, -10 ],
+ [ -11, -12 ]
+ ],
+ [
+ [ -13, -14 ],
+ [ -15, -16 ]
+ ]
+ ];
+
+ expected = [];
+ actual = flatten3dBy( x, [ 0, 0, 0 ], false, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [];
+ actual = flatten3dBy( x, [ 0, 0, 1 ], false, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [];
+ actual = flatten3dBy( x, [ 1, 0, 0 ], false, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1 ];
+ actual = flatten3dBy( x, [ 1, 1, 1 ], false, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 2 ];
+ actual = flatten3dBy( x, [ 1, 1, 2 ], false, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 5 ];
+ actual = flatten3dBy( x, [ 2, 1, 1 ], false, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 2, 5, 6 ];
+ actual = flatten3dBy( x, [ 2, 1, 2 ], false, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ];
+ actual = flatten3dBy( x, [ 3, 2, 2 ], false, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 5, 9, 13 ];
+ actual = flatten3dBy( x, [ 4, 1, 1 ], false, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 2, 5, 6, 9, 10, 13, 14 ];
+ actual = flatten3dBy( x, [ 4, 1, 2 ], false, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ];
+ actual = flatten3dBy( x, [ 4, 2, 2 ], false, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function flattens a nested array (colexicographic)', function test( t ) {
+ var expected;
+ var actual;
+ var x;
+
+ x = [
+ [
+ [ -1, -2 ],
+ [ -3, -4 ]
+ ],
+ [
+ [ -5, -6 ],
+ [ -7, -8 ]
+ ],
+ [
+ [ -9, -10 ],
+ [ -11, -12 ]
+ ],
+ [
+ [ -13, -14 ],
+ [ -15, -16 ]
+ ]
+ ];
+
+ expected = [];
+ actual = flatten3dBy( x, [ 0, 0, 0 ], true, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [];
+ actual = flatten3dBy( x, [ 0, 0, 1 ], true, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [];
+ actual = flatten3dBy( x, [ 1, 0, 0 ], true, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1 ];
+ actual = flatten3dBy( x, [ 1, 1, 1 ], true, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 2 ];
+ actual = flatten3dBy( x, [ 1, 1, 2 ], true, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 5 ];
+ actual = flatten3dBy( x, [ 2, 1, 1 ], true, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 5, 2, 6 ];
+ actual = flatten3dBy( x, [ 2, 1, 2 ], true, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 5, 9, 3, 7, 11, 2, 6, 10, 4, 8, 12 ];
+ actual = flatten3dBy( x, [ 3, 2, 2 ], true, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 5, 9, 13 ];
+ actual = flatten3dBy( x, [ 4, 1, 1 ], true, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 5, 9, 13, 2, 6, 10, 14 ];
+ actual = flatten3dBy( x, [ 4, 1, 2 ], true, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ expected = [ 1, 5, 9, 13, 3, 7, 11, 15, 2, 6, 10, 14, 4, 8, 12, 16 ];
+ actual = flatten3dBy( x, [ 4, 2, 2 ], true, clbk );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports setting the callback execution context (lexicographic)', function test( t ) {
+ var ctx;
+ var x;
+
+ x = [
+ [
+ [ 1, 2 ],
+ [ 3, 4 ]
+ ]
+ ];
+
+ ctx = {
+ 'count': 0
+ };
+
+ flatten3dBy( x, [ 1, 2, 2 ], false, fcn, ctx );
+ t.strictEqual( ctx.count, 4, 'returns expected value' );
+
+ t.end();
+
+ function fcn( value, indices, arr ) {
+ this.count += 1; // eslint-disable-line no-invalid-this
+ t.strictEqual( indices.length, 3, 'returns expected value' );
+ t.strictEqual( value, arr[ indices[0] ][ indices[1] ][ indices[2] ], 'returns expected value' );
+ t.strictEqual( arr, x, 'returns expected value' );
+ }
+});
+
+tape( 'the function supports setting the callback execution context (colexicographic)', function test( t ) {
+ var ctx;
+ var x;
+
+ x = [
+ [
+ [ 1, 2 ],
+ [ 3, 4 ]
+ ]
+ ];
+
+ ctx = {
+ 'count': 0
+ };
+
+ flatten3dBy( x, [ 1, 2, 2 ], true, fcn, ctx );
+ t.strictEqual( ctx.count, 4, 'returns expected value' );
+
+ t.end();
+
+ function fcn( value, indices, arr ) {
+ this.count += 1; // eslint-disable-line no-invalid-this
+ t.strictEqual( indices.length, 3, 'returns expected value' );
+ t.strictEqual( value, arr[ indices[0] ][ indices[1] ][ indices[2] ], 'returns expected value' );
+ t.strictEqual( arr, x, 'returns expected value' );
+ }
+});