diff --git a/lib/node_modules/@stdlib/ndarray/some-by/README.md b/lib/node_modules/@stdlib/ndarray/some-by/README.md
new file mode 100644
index 000000000000..8d0c0893df2c
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/README.md
@@ -0,0 +1,313 @@
+
+
+# someBy
+
+> Test whether at least `n` elements along one or more [`ndarray`][@stdlib/ndarray/ctor] dimensions pass a test implemented by a predicate function.
+
+
+
+
+
+
+
+## Usage
+
+```javascript
+var someBy = require( '@stdlib/ndarray/some-by' );
+```
+
+#### someBy( x, n\[, options], predicate\[, thisArg] )
+
+Tests whether at least `n` elements along one or more [`ndarray`][@stdlib/ndarray/ctor] dimensions pass a test implemented by a predicate function.
+
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+
+function predicate( value ) {
+ return value > 0.0;
+}
+
+// Create an input ndarray:
+var x = array( [ [ [ 1.0, 2.0 ] ], [ [ 3.0, 4.0 ] ], [ [ 0.0, 6.0 ] ] ] );
+// returns
+
+// Perform reduction:
+var out = someBy( x, 2, predicate );
+// returns
+
+console.log( out.get() );
+// => true
+```
+
+The function accepts the following arguments:
+
+- **x**: input [`ndarray`][@stdlib/ndarray/ctor].
+- **n**: number of elements which must pass the test implemented by a predicate function. May be either a scalar or an [`ndarray`][@stdlib/ndarray/ctor]. Must be [broadcast-compatible][@stdlib/ndarray/base/broadcast-shapes] with the non-reduced dimensions of input [`ndarray`][@stdlib/ndarray/ctor]. Must have an integer [data type][@stdlib/ndarray/dtypes].
+- **options**: function options (_optional_).
+- **predicate**: predicate function.
+- **thisArg**: predicate execution context (_optional_).
+
+The function accepts the following `options`:
+
+- **dims**: list of dimensions over which to perform a reduction.
+- **keepdims**: boolean indicating whether the reduced dimensions should be included in the returned [`ndarray`][@stdlib/ndarray/ctor] as singleton dimensions. Default: `false`.
+
+By default, the function performs a reduction over all elements in a provided [`ndarray`][@stdlib/ndarray/ctor]. To reduce specific dimensions, set the `dims` option.
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+
+function predicate( value ) {
+ return value > 0.0;
+}
+
+// Create an input ndarray:
+var x = array( [ [ [ 1.0, 2.0 ] ], [ [ 3.0, 4.0 ] ], [ [ 0.0, 6.0 ] ] ] );
+// returns
+
+var opts = {
+ 'dims': [ 0, 1 ]
+};
+
+// Perform reduction:
+var out = someBy( x, 2, opts, predicate );
+// returns
+
+var v = ndarray2array( out );
+// returns [ true, true ]
+```
+
+By default, the function returns an [`ndarray`][@stdlib/ndarray/ctor] having a shape matching only the non-reduced dimensions of the input [`ndarray`][@stdlib/ndarray/ctor] (i.e., the reduced dimensions are dropped). To include the reduced dimensions as singleton dimensions in the output [`ndarray`][@stdlib/ndarray/ctor], set the `keepdims` option to `true`.
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+
+function predicate( value ) {
+ return value > 0.0;
+}
+
+// Create an input ndarray:
+var x = array( [ [ [ 1.0, 2.0 ] ], [ [ 3.0, 4.0 ] ], [ [ 0.0, 6.0 ] ] ] );
+// returns
+
+var opts = {
+ 'dims': [ 0, 1 ],
+ 'keepdims': true
+};
+
+// Perform reduction:
+var out = someBy( x, 2, opts, predicate );
+// returns
+
+var v = ndarray2array( out );
+// returns [ [ [ true, true ] ] ]
+```
+
+To set the predicate function execution context, provide a `thisArg`.
+
+
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+
+function predicate( value ) {
+ this.count += 1;
+ return value > 0.0;
+}
+
+// Create an input ndarray:
+var x = array( [ [ [ 1.0, 2.0 ] ], [ [ 3.0, 4.0 ] ], [ [ 0.0, 6.0 ] ] ] );
+// returns
+
+// Create a context object:
+var ctx = {
+ 'count': 0
+};
+
+// Perform operation:
+var out = someBy( x, 2, predicate, ctx );
+// returns
+
+var v = out.get();
+// returns true
+
+var count = ctx.count;
+// returns 2
+```
+
+#### someBy.assign( x, n, out\[, options], predicate\[, thisArg] )
+
+Tests whether at least `n` elements along one or more [`ndarray`][@stdlib/ndarray/ctor] dimensions pass a test implemented by a predicate function and assigns results to a provided output [`ndarray`][@stdlib/ndarray/ctor].
+
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+var empty = require( '@stdlib/ndarray/empty' );
+
+function predicate( value ) {
+ return value > 0.0;
+}
+
+// Create an input ndarray:
+var x = array( [ [ [ 1.0, 2.0 ] ], [ [ 3.0, 4.0 ] ], [ [ 0.0, 6.0 ] ] ] );
+// returns
+
+// Create an output ndarray:
+var y = empty( [], {
+ 'dtype': 'bool'
+});
+
+// Perform reduction:
+var out = someBy.assign( x, 2, y, predicate );
+// returns
+
+var bool = ( out === y );
+// returns true
+
+var v = y.get();
+// returns true
+```
+
+The function accepts the following arguments:
+
+- **x**: input [`ndarray`][@stdlib/ndarray/ctor].
+- **n**: number of elements which must pass the test implemented by a predicate function. May be either a scalar or an [`ndarray`][@stdlib/ndarray/ctor]. Must be [broadcast-compatible][@stdlib/ndarray/base/broadcast-shapes] with the non-reduced dimensions of input [`ndarray`][@stdlib/ndarray/ctor]. Must have an integer [data type][@stdlib/ndarray/dtypes].
+- **out**: output [`ndarray`][@stdlib/ndarray/ctor]. The output [`ndarray`][@stdlib/ndarray/ctor] must have a shape matching the non-reduced dimensions of the input [`ndarray`][@stdlib/ndarray/ctor].
+- **options**: function options (_optional_).
+- **predicate**: predicate function.
+- **thisArg**: predicate execution context (_optional_).
+
+The function accepts the following `options`:
+
+- **dims**: list of dimensions over which to perform a reduction.
+
+By default, the function performs a reduction over all elements in a provided [`ndarray`][@stdlib/ndarray/ctor]. To reduce specific dimensions, set the `dims` option.
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+var empty = require( '@stdlib/ndarray/empty' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+
+function predicate( value ) {
+ return value > 0.0;
+}
+
+// Create an input ndarray:
+var x = array( [ [ [ 1.0, 2.0 ] ], [ [ 3.0, 4.0 ] ], [ [ 0.0, 6.0 ] ] ] );
+// returns
+
+// Create an output ndarray:
+var y = empty( [ 2 ], {
+ 'dtype': 'bool'
+});
+
+var opts = {
+ 'dims': [ 0, 1 ]
+};
+
+// Perform reduction:
+var out = someBy.assign( x, 2, y, opts, predicate );
+
+var bool = ( out === y );
+// returns true
+
+var v = ndarray2array( y );
+// returns [ true, true ]
+```
+
+
+
+
+
+
+
+## Notes
+
+- The predicate function is provided the following arguments:
+
+ - **value**: current array element.
+ - **indices**: current array element indices.
+ - **arr**: the input ndarray.
+
+
+
+
+
+
+
+## Examples
+
+
+
+```javascript
+var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
+var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
+var fillBy = require( '@stdlib/ndarray/fill-by' );
+var zeros = require( '@stdlib/ndarray/zeros' );
+var someBy = require( '@stdlib/ndarray/some-by' );
+
+var x = zeros( [ 2, 4, 5 ], {
+ 'dtype': 'float64'
+});
+x = fillBy( x, discreteUniform( 0, 10 ) );
+console.log( ndarray2array( x ) );
+
+var n = scalar2ndarray( 4, {
+ 'dtype': 'int8'
+});
+var y = someBy( x, n, isEven );
+console.log( y.get() );
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/ctor
+
+[@stdlib/ndarray/base/broadcast-shapes]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/broadcast-shapes
+
+[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/dtypes
+
+
+
+
+
+
+
+
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/benchmark/benchmark.1d.js b/lib/node_modules/@stdlib/ndarray/some-by/benchmark/benchmark.1d.js
new file mode 100644
index 000000000000..7595e65130a5
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/benchmark/benchmark.1d.js
@@ -0,0 +1,141 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
+var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
+var ndarray = require( '@stdlib/ndarray/ctor' );
+var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
+var pkg = require( './../package.json' ).name;
+var someBy = require( './../lib' );
+
+
+// VARIABLES //
+
+var types = [ 'float64' ];
+var orders = [ 'row-major', 'column-major' ];
+
+
+// FUNCTIONS //
+
+/**
+* Creates a benchmark function.
+*
+* @private
+* @param {PositiveInteger} len - ndarray length
+* @param {NonNegativeIntegerArray} shape - ndarray shape
+* @param {string} xtype - ndarray data type
+* @param {string} order - memory layout
+* @param {NonNegativeIntegerArray} dims - list of dimensions to reduce
+* @returns {Function} benchmark function
+*/
+function createBenchmark( len, shape, xtype, order, dims ) {
+ var x;
+
+ x = discreteUniform( len, 1, 100 );
+ x = new ndarray( xtype, x, shape, shape2strides( shape, order ), 0, order );
+
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var opts;
+ var out;
+ var i;
+
+ opts = {
+ 'dims': dims
+ };
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ out = someBy( x, len, opts, isEven );
+ if ( typeof out !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( out ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+/**
+* Main execution sequence.
+*
+* @private
+*/
+function main() {
+ var dims;
+ var len;
+ var min;
+ var max;
+ var ord;
+ var sh;
+ var t1;
+ var f;
+ var i;
+ var j;
+ var k;
+ var n;
+ var d;
+
+ min = 1; // 10^min
+ max = 6; // 10^max
+
+ d = [
+ [ 0 ],
+ []
+ ];
+
+ for ( n = 0; n < d.length; n++ ) {
+ dims = d[ n ];
+ for ( k = 0; k < orders.length; k++ ) {
+ ord = orders[ k ];
+ for ( j = 0; j < types.length; j++ ) {
+ t1 = types[ j ];
+ for ( i = min; i <= max; i++ ) {
+ len = pow( 10, i );
+
+ sh = [ len ];
+ f = createBenchmark( len, sh, t1, ord, dims );
+ bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',' )+']', f );
+ }
+ }
+ }
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/benchmark/benchmark.2d.js b/lib/node_modules/@stdlib/ndarray/some-by/benchmark/benchmark.2d.js
new file mode 100644
index 000000000000..4fe00d34c721
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/benchmark/benchmark.2d.js
@@ -0,0 +1,155 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var sqrt = require( '@stdlib/math/base/special/sqrt' );
+var floor = require( '@stdlib/math/base/special/floor' );
+var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
+var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
+var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
+var ndarray = require( '@stdlib/ndarray/ctor' );
+var pkg = require( './../package.json' ).name;
+var someBy = require( './../lib' );
+
+
+// VARIABLES //
+
+var types = [ 'float64' ];
+var orders = [ 'row-major', 'column-major' ];
+
+
+// FUNCTIONS //
+
+/**
+* Creates a benchmark function.
+*
+* @private
+* @param {PositiveInteger} len - ndarray length
+* @param {NonNegativeIntegerArray} shape - ndarray shape
+* @param {string} xtype - ndarray data type
+* @param {string} order - memory layout
+* @param {NonNegativeIntegerArray} dims - list of dimensions to reduce
+* @returns {Function} benchmark function
+*/
+function createBenchmark( len, shape, xtype, order, dims ) {
+ var x;
+
+ x = discreteUniform( len, 1, 100 );
+ x = new ndarray( xtype, x, shape, shape2strides( shape, order ), 0, order );
+
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var opts;
+ var out;
+ var i;
+
+ opts = {
+ 'dims': dims
+ };
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ out = someBy( x, len, opts, isEven );
+ if ( typeof out !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( out ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+/**
+* Main execution sequence.
+*
+* @private
+*/
+function main() {
+ var dims;
+ var len;
+ var min;
+ var max;
+ var ord;
+ var sh;
+ var t1;
+ var f;
+ var i;
+ var j;
+ var k;
+ var n;
+ var d;
+
+ min = 1; // 10^min
+ max = 6; // 10^max
+
+ d = [
+ [ 0, 1 ],
+ [ 0 ],
+ [ 1 ],
+ []
+ ];
+
+ for ( n = 0; n < d.length; n++ ) {
+ dims = d[ n ];
+ for ( k = 0; k < orders.length; k++ ) {
+ ord = orders[ k ];
+ for ( j = 0; j < types.length; j++ ) {
+ t1 = types[ j ];
+ for ( i = min; i <= max; i++ ) {
+ len = pow( 10, i );
+
+ sh = [ len/2, 2 ];
+ f = createBenchmark( len, sh, t1, ord, dims );
+ bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',' )+']', f );
+
+ sh = [ 2, len/2 ];
+ f = createBenchmark( len, sh, t1, ord, dims );
+ bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',' )+']', f );
+
+ len = floor( sqrt( len ) );
+ sh = [ len, len ];
+ len *= len;
+ f = createBenchmark( len, sh, t1, ord, dims );
+ bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',' )+']', f );
+ }
+ }
+ }
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/some-by/docs/repl.txt
new file mode 100644
index 000000000000..b8d128e5eb97
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/docs/repl.txt
@@ -0,0 +1,111 @@
+
+{{alias}}( x, n[, options], predicate[, thisArg] )
+ Tests whether at least `n` elements along one or more ndarray dimensions
+ pass a test implemented by a predicate function.
+
+ Parameters
+ ----------
+ x: ndarray
+ Input ndarray.
+
+ n: ndarray|integer
+ Number of elements which must pass the test implemented by a predicate
+ function. Must be broadcast compatible with the non-reduced dimensions
+ of input ndarray. Must have an integer data type.
+
+ options: Object (optional)
+ Function options.
+
+ options.dims: Array (optional)
+ List of dimensions over which to perform a reduction. If not provided,
+ the function performs a reduction over all elements in a provided input
+ ndarray.
+
+ options.keepdims: boolean (optional)
+ Boolean indicating whether the reduced dimensions should be included in
+ the returned ndarray as singleton dimensions. Default: false.
+
+ predicate: Function
+ Predicate function.
+
+ thisArg: Any (optional)
+ Predicate execution context.
+
+ Returns
+ -------
+ out: ndarray
+ Output ndarray. When performing a reduction over all elements, the
+ function returns a zero-dimensional ndarray containing the result.
+
+ Examples
+ --------
+ > function f ( v ) { return v > 0.0; };
+ > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2], [ 3, 4 ] ] );
+ > var y = {{alias}}( x, 3, f )
+
+ > y.get()
+ true
+ > y = {{alias}}( x, 3, { 'keepdims': true }, f )
+
+ > {{alias:@stdlib/ndarray/to-array}}( y )
+ [ [ true ] ]
+ > y.get( 0, 0 )
+ true
+
+
+{{alias}}.assign( x, n, y[, options], predicate[, thisArg] )
+ Tests whether at least `n` elements along one or more ndarray dimensions
+ pass a test implemented by a predicate function.
+
+ Parameters
+ ----------
+ x: ndarray
+ Input ndarray.
+
+ n: ndarray|integer
+ Number of elements which must pass the test implemented by a predicate
+ function. Must be broadcast compatible with the non-reduced dimensions
+ of input ndarray. Must have an integer data type.
+
+ y: ndarray
+ Output ndarray. The output shape must match the shape of the non-reduced
+ dimensions of the input ndarray.
+
+ options: Object (optional)
+ Function options.
+
+ options.dims: Array (optional)
+ List of dimensions over which to perform a reduction. If not provided,
+ the function performs a reduction over all elements in a provided input
+ ndarray.
+
+ options.keepdims: boolean (optional)
+ Boolean indicating whether the reduced dimensions should be included in
+ the returned ndarray as singleton dimensions. Default: false.
+
+ predicate: Function
+ Predicate function.
+
+ thisArg: Any (optional)
+ Predicate execution context.
+
+ Returns
+ -------
+ y: ndarray
+ Output ndarray.
+
+ Examples
+ --------
+ > function f ( v ) { return v > 0.0 };
+ > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2], [ 3, 4 ] ] );
+ > var y = {{alias:@stdlib/ndarray/from-scalar}}( false );
+ > var out = {{alias}}.assign( x, 3, y, f )
+
+ > var bool = ( out === y )
+ true
+ > y.get()
+ true
+
+ See Also
+ --------
+
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/some-by/docs/types/index.d.ts
new file mode 100644
index 000000000000..3cc6bf04112f
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/docs/types/index.d.ts
@@ -0,0 +1,344 @@
+/*
+* @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 { ArrayLike } from '@stdlib/types/array';
+import { ndarray, boolndarray, integerndarray, typedndarray } from '@stdlib/types/ndarray';
+
+/**
+* Returns a boolean indicating whether an element passes a test.
+*
+* @returns boolean indicating whether an ndarray element passes a test
+*/
+type Nullary = ( this: ThisArg ) => boolean;
+
+/**
+* Returns a boolean indicating whether an element passes a test.
+*
+* @param value - current array element
+* @returns boolean indicating whether an ndarray element passes a test
+*/
+type Unary = ( this: ThisArg, value: T ) => boolean;
+
+/**
+* Returns a boolean indicating whether an element passes a test.
+*
+* @param value - current array element
+* @param indices - current array element indices
+* @returns boolean indicating whether an ndarray element passes a test
+*/
+type Binary = ( this: ThisArg, value: T, indices: Array ) => boolean;
+
+/**
+* Returns a boolean indicating whether an element passes a test.
+*
+* @param value - current array element
+* @param indices - current array element indices
+* @param arr - input array
+* @returns boolean indicating whether an ndarray element passes a test
+*/
+type Ternary = ( this: ThisArg, value: T, indices: Array, arr: typedndarray ) => boolean;
+
+/**
+* Returns a boolean indicating whether an element passes a test.
+*
+* @param value - current array element
+* @param indices - current array element indices
+* @param arr - input array
+* @returns boolean indicating whether an ndarray element passes a test
+*/
+type Predicate = Nullary | Unary | Binary | Ternary;
+
+/**
+* Base options.
+*/
+interface BaseOptions {
+ /**
+ * List of dimensions over which to perform the reduction.
+ */
+ dims?: ArrayLike;
+}
+
+/**
+* Options.
+*/
+interface Options extends BaseOptions {
+ /**
+ * Boolean indicating whether the reduced dimensions should be included in the returned ndarray as singleton dimensions. Default: `false`.
+ */
+ keepdims?: boolean;
+}
+
+/**
+* Interface describing `someBy`.
+*/
+interface SomeBy {
+ /**
+ * Tests whether at least `n` elements along one or more ndarray dimensions pass a test implemented by a predicate function.
+ *
+ * @param x - input ndarray
+ * @param n - number of elements which must pass a test
+ * @param predicate - predicate function
+ * @param thisArg - predicate execution context
+ * @returns output ndarray
+ *
+ * @example
+ * var Float64Array = require( '@stdlib/array/float64' );
+ * var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
+ * var ndarray = require( '@stdlib/ndarray/ctor' );
+ *
+ * // Create a data buffer:
+ * var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
+ *
+ * // Define the shape of the input array:
+ * var sh = [ 3, 1, 2 ];
+ *
+ * // Define the array strides:
+ * var sx = [ 4, 4, 1 ];
+ *
+ * // Define the index offset:
+ * var ox = 1;
+ *
+ * // Create an input ndarray:
+ * var x = new ndarray( 'float64', xbuf, sh, sx, ox, 'row-major' );
+ *
+ * // Perform reduction:
+ * var out = someBy( x, 3, isEven );
+ * // returns
+ *
+ * var v = out.get();
+ * // returns true
+ */
+ ( x: ndarray, n: integerndarray | number, predicate: Predicate, thisArg?: ThisParameterType> ): boolndarray;
+
+ /**
+ * Tests whether at least `n` elements along one or more ndarray dimensions pass a test implemented by a predicate function.
+ *
+ * @param x - input ndarray
+ * @param n - number of elements which must pass a test
+ * @param options - function options
+ * @param options.dims - list of dimensions over which to perform a reduction
+ * @param options.keepdims - boolean indicating whether the reduced dimensions should be included in the returned ndarray as singleton dimensions (default: false)
+ * @param predicate - predicate function
+ * @param thisArg - predicate execution context
+ * @returns output ndarray
+ *
+ * @example
+ * var Float64Array = require( '@stdlib/array/float64' );
+ * var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
+ * var ndarray = require( '@stdlib/ndarray/ctor' );
+ *
+ * // Create a data buffer:
+ * var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
+ *
+ * // Define the shape of the input array:
+ * var sh = [ 3, 1, 2 ];
+ *
+ * // Define the array strides:
+ * var sx = [ 4, 4, 1 ];
+ *
+ * // Define the index offset:
+ * var ox = 1;
+ *
+ * // Create an input ndarray:
+ * var x = new ndarray( 'float64', xbuf, sh, sx, ox, 'row-major' );
+ *
+ * // Perform reduction:
+ * var out = someBy( x, 3, {}, isEven );
+ * // returns
+ *
+ * var v = out.get();
+ * // returns true
+ */
+ ( x: ndarray, n: integerndarray | number, options: Options, predicate: Predicate, thisArg?: ThisParameterType> ): boolndarray;
+
+ /**
+ * Tests whether at least `n` elements along one or more ndarray dimensions pass a test implemented by a predicate function.
+ *
+ * @param x - input ndarray
+ * @param n - number of elements which must pass a test
+ * @param y - output ndarray
+ * @param predicate - predicate function
+ * @param thisArg - predicate execution context
+ * @returns output ndarray
+ *
+ * @example
+ * var Float64Array = require( '@stdlib/array/float64' );
+ * var ndarray = require( '@stdlib/ndarray/ctor' );
+ * var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
+ * var empty = require( '@stdlib/ndarray/empty' );
+ *
+ * // Create a data buffer:
+ * var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
+ *
+ * // Define the shape of the input array:
+ * var shape = [ 3, 1, 2 ];
+ *
+ * // Define the array strides:
+ * var sx = [ 4, 4, 1 ];
+ *
+ * // Define the index offset:
+ * var ox = 1;
+ *
+ * // Create an input ndarray:
+ * var x = new ndarray( 'float64', xbuf, shape, sx, ox, 'row-major' );
+ *
+ * // Create an output ndarray:
+ * var y = empty( [], {
+ * 'dtype': 'bool'
+ * });
+ *
+ * // Perform reduction:
+ * var out = someBy.assign( x, 3, y, isEven );
+ * // returns
+ *
+ * var v = out.get();
+ * // returns true
+ */
+ assign( x: ndarray, n: integerndarray | number, y: U, predicate: Predicate, thisArg?: ThisParameterType> ): U;
+
+ /**
+ * Tests whether at least `n` elements along one or more ndarray dimensions pass a test implemented by a predicate function.
+ *
+ * @param x - input ndarray
+ * @param n - number of elements which must pass a test
+ * @param y - output ndarray
+ * @param options - function options
+ * @param options.dims - list of dimensions over which to perform a reduction
+ * @param predicate - predicate function
+ * @param thisArg - predicate execution context
+ * @returns output ndarray
+ *
+ * @example
+ * var Float64Array = require( '@stdlib/array/float64' );
+ * var ndarray = require( '@stdlib/ndarray/ctor' );
+ * var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
+ * var empty = require( '@stdlib/ndarray/empty' );
+ *
+ * // Create a data buffer:
+ * var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
+ *
+ * // Define the shape of the input array:
+ * var shape = [ 3, 1, 2 ];
+ *
+ * // Define the array strides:
+ * var sx = [ 4, 4, 1 ];
+ *
+ * // Define the index offset:
+ * var ox = 1;
+ *
+ * // Create an input ndarray:
+ * var x = new ndarray( 'float64', xbuf, shape, sx, ox, 'row-major' );
+ *
+ * // Create an output ndarray:
+ * var y = empty( [], {
+ * 'dtype': 'bool'
+ * });
+ *
+ * // Perform reduction:
+ * var out = someBy.assign( x, 3, y, {}, isEven );
+ * // returns
+ *
+ * var v = out.get();
+ * // returns true
+ */
+ assign( x: ndarray, n: integerndarray | number, y: U, options: BaseOptions, predicate: Predicate, thisArg?: ThisParameterType> ): U;
+}
+
+/**
+* Tests whether at least `n` elements along one or more ndarray dimensions pass a test implemented by a predicate function.
+*
+* @param x - input ndarray
+* @param n - number of elements which must pass a test
+* @param options - function options
+* @param options.dims - list of dimensions over which to perform a reduction
+* @param options.keepdims - boolean indicating whether the reduced dimensions should be included in the returned ndarray as singleton dimensions (default: false)
+* @param predicate - predicate function
+* @param thisArg - predicate execution context
+* @returns output ndarray
+*
+* @example
+* var Float64Array = require( '@stdlib/array/float64' );
+* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
+* var ndarray = require( '@stdlib/ndarray/ctor' );
+*
+* // Create a data buffer:
+* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
+*
+* // Define the shape of the input array:
+* var sh = [ 3, 1, 2 ];
+*
+* // Define the array strides:
+* var sx = [ 4, 4, 1 ];
+*
+* // Define the index offset:
+* var ox = 1;
+*
+* // Create an input ndarray:
+* var x = new ndarray( 'float64', xbuf, sh, sx, ox, 'row-major' );
+*
+* // Perform reduction:
+* var out = someBy( x, 3, isEven );
+* // returns
+*
+* var v = out.get();
+* // returns true
+*
+* @example
+* var Float64Array = require( '@stdlib/array/float64' );
+* var ndarray = require( '@stdlib/ndarray/ctor' );
+* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
+* var empty = require( '@stdlib/ndarray/empty' );
+*
+* // Create a data buffer:
+* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
+*
+* // Define the shape of the input array:
+* var shape = [ 3, 1, 2 ];
+*
+* // Define the array strides:
+* var sx = [ 4, 4, 1 ];
+*
+* // Define the index offset:
+* var ox = 1;
+*
+* // Create an input ndarray:
+* var x = new ndarray( 'float64', xbuf, shape, sx, ox, 'row-major' );
+*
+* // Create an output ndarray:
+* var y = empty( [], {
+* 'dtype': 'bool'
+* });
+*
+* // Perform reduction:
+* var out = someBy.assign( x, 3, y, isEven );
+* // returns
+*
+* var v = out.get();
+* // returns true
+*/
+declare var someBy: SomeBy;
+
+
+// EXPORTS //
+
+export = someBy;
+
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/some-by/docs/types/test.ts
new file mode 100644
index 000000000000..347da93b12a1
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/docs/types/test.ts
@@ -0,0 +1,508 @@
+/*
+* @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.
+*/
+
+/* eslint-disable space-in-parens */
+
+///
+
+import zeros = require( '@stdlib/ndarray/zeros' );
+import empty = require( '@stdlib/ndarray/empty' );
+import someBy = require( './index' );
+
+/**
+* Predicate function.
+*
+* @param v - ndarray element
+* @returns result
+*/
+function clbk( v: any ): boolean {
+ return v > 0.0;
+}
+
+
+// TESTS //
+
+// The function returns an ndarray...
+{
+ const x = zeros( [ 2, 2 ] );
+ const n = zeros( [], {
+ 'dtype': 'int32'
+ });
+
+ someBy( x, 2, clbk ); // $ExpectType boolndarray
+ someBy( x, 2, { 'keepdims': true }, clbk ); // $ExpectType boolndarray
+ someBy( x, 2, { 'dims': [ 0 ] }, clbk ); // $ExpectType boolndarray
+
+ someBy( x, 2, clbk, {} ); // $ExpectType boolndarray
+ someBy( x, 2, {}, clbk, {} ); // $ExpectType boolndarray
+ someBy( x, 2, { 'keepdims': true }, clbk, {} ); // $ExpectType boolndarray
+ someBy( x, 2, { 'dims': [ 0 ] }, clbk, {} ); // $ExpectType boolndarray
+
+ someBy( x, n, clbk ); // $ExpectType boolndarray
+ someBy( x, n, { 'keepdims': true }, clbk ); // $ExpectType boolndarray
+ someBy( x, n, { 'dims': [ 0 ] }, clbk ); // $ExpectType boolndarray
+
+ someBy( x, n, clbk, {} ); // $ExpectType boolndarray
+ someBy( x, n, {}, clbk, {} ); // $ExpectType boolndarray
+ someBy( x, n, { 'keepdims': true }, clbk, {} ); // $ExpectType boolndarray
+ someBy( x, n, { 'dims': [ 0 ] }, clbk, {} ); // $ExpectType boolndarray
+}
+
+// The compiler throws an error if the function is provided a first argument which is not an ndarray...
+{
+ someBy( 5, 2, clbk ); // $ExpectError
+ someBy( true, 2, clbk ); // $ExpectError
+ someBy( false, 2, clbk ); // $ExpectError
+ someBy( null, 2, clbk ); // $ExpectError
+ someBy( undefined, 2, clbk ); // $ExpectError
+ someBy( {}, 2, clbk ); // $ExpectError
+ someBy( [ 1 ], 2, clbk ); // $ExpectError
+ someBy( ( x: number ): number => x, 2, clbk ); // $ExpectError
+
+ someBy( 5, 2, {}, clbk ); // $ExpectError
+ someBy( true, 2, {}, clbk ); // $ExpectError
+ someBy( false, 2, {}, clbk ); // $ExpectError
+ someBy( null, 2, {}, clbk ); // $ExpectError
+ someBy( undefined, 2, {}, clbk ); // $ExpectError
+ someBy( {}, 2, {}, clbk ); // $ExpectError
+ someBy( [ 1 ], 2, {}, clbk ); // $ExpectError
+ someBy( ( x: number ): number => x, 2, {}, clbk ); // $ExpectError
+
+ someBy( 5, 2, clbk, {} ); // $ExpectError
+ someBy( true, 2, clbk, {} ); // $ExpectError
+ someBy( false, 2, clbk, {} ); // $ExpectError
+ someBy( null, 2, clbk, {} ); // $ExpectError
+ someBy( undefined, 2, clbk, {} ); // $ExpectError
+ someBy( {}, 2, clbk, {} ); // $ExpectError
+ someBy( [ 1 ], 2, clbk, {} ); // $ExpectError
+ someBy( ( x: number ): number => x, 2, clbk, {} ); // $ExpectError
+
+ someBy( 5, 2, {}, clbk, {} ); // $ExpectError
+ someBy( true, 2, {}, clbk, {} ); // $ExpectError
+ someBy( false, 2, {}, clbk, {} ); // $ExpectError
+ someBy( null, 2, {}, clbk, {} ); // $ExpectError
+ someBy( undefined, 2, {}, clbk, {} ); // $ExpectError
+ someBy( {}, 2, {}, clbk, {} ); // $ExpectError
+ someBy( [ 1 ], 2, {}, clbk, {} ); // $ExpectError
+ someBy( ( x: number ): number => x, 2, {}, clbk, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a second argument which is not an integer ndarray or a number...
+{
+ const x = zeros( [ 2, 2 ] );
+
+ someBy( x, '5', clbk ); // $ExpectError
+ someBy( x, true, clbk ); // $ExpectError
+ someBy( x, false, clbk ); // $ExpectError
+ someBy( x, null, clbk ); // $ExpectError
+ someBy( x, undefined, clbk ); // $ExpectError
+ someBy( x, {}, clbk ); // $ExpectError
+ someBy( x, [ 1 ], clbk ); // $ExpectError
+ someBy( x, ( x: number ): number => x, clbk ); // $ExpectError
+
+ someBy( x, '5', {}, clbk ); // $ExpectError
+ someBy( x, true, {}, clbk ); // $ExpectError
+ someBy( x, false, {}, clbk ); // $ExpectError
+ someBy( x, null, {}, clbk ); // $ExpectError
+ someBy( x, undefined, {}, clbk ); // $ExpectError
+ someBy( x, {}, {}, clbk ); // $ExpectError
+ someBy( x, [ 1 ], {}, clbk ); // $ExpectError
+ someBy( x, ( x: number ): number => x, {}, clbk ); // $ExpectError
+
+ someBy( x, '5', clbk, {} ); // $ExpectError
+ someBy( x, true, clbk, {} ); // $ExpectError
+ someBy( x, false, clbk, {} ); // $ExpectError
+ someBy( x, null, clbk, {} ); // $ExpectError
+ someBy( x, undefined, clbk, {} ); // $ExpectError
+ someBy( x, {}, clbk, {} ); // $ExpectError
+ someBy( x, [ 1 ], clbk, {} ); // $ExpectError
+ someBy( x, ( x: number ): number => x, clbk, {} ); // $ExpectError
+
+ someBy( x, '5', {}, clbk, {} ); // $ExpectError
+ someBy( x, true, {}, clbk, {} ); // $ExpectError
+ someBy( x, false, {}, clbk, {} ); // $ExpectError
+ someBy( x, null, {}, clbk, {} ); // $ExpectError
+ someBy( x, undefined, {}, clbk, {} ); // $ExpectError
+ someBy( x, {}, {}, clbk, {} ); // $ExpectError
+ someBy( x, [ 1 ], {}, clbk, {} ); // $ExpectError
+ someBy( x, ( x: number ): number => x, {}, clbk, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an options argument which is not an object...
+{
+ const x = zeros( [ 2, 2 ] );
+
+ someBy( x, 2, '5', clbk ); // $ExpectError
+ someBy( x, 2, 5, clbk ); // $ExpectError
+ someBy( x, 2, true, clbk ); // $ExpectError
+ someBy( x, 2, false, clbk ); // $ExpectError
+ someBy( x, 2, null, clbk ); // $ExpectError
+ someBy( x, 2, [ 1 ], clbk ); // $ExpectError
+ someBy( x, 2, ( x: number ): number => x, clbk ); // $ExpectError
+
+ someBy( x, 2, '5', clbk, {} ); // $ExpectError
+ someBy( x, 2, 5, clbk, {} ); // $ExpectError
+ someBy( x, 2, true, clbk, {} ); // $ExpectError
+ someBy( x, 2, false, clbk, {} ); // $ExpectError
+ someBy( x, 2, null, clbk, {} ); // $ExpectError
+ someBy( x, 2, [ 1 ], clbk, {} ); // $ExpectError
+ someBy( x, 2, ( x: number ): number => x, clbk, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a callback argument which is not a function...
+{
+ const x = zeros( [ 2, 2 ] );
+
+ someBy( x, 2, '5' ); // $ExpectError
+ someBy( x, 2, 5 ); // $ExpectError
+ someBy( x, 2, true ); // $ExpectError
+ someBy( x, 2, false ); // $ExpectError
+ someBy( x, 2, null ); // $ExpectError
+ someBy( x, 2, [ 1 ] ); // $ExpectError
+ someBy( x, 2, {} ); // $ExpectError
+
+ someBy( x, 2, '5', {} ); // $ExpectError
+ someBy( x, 2, 5, {} ); // $ExpectError
+ someBy( x, 2, true, {} ); // $ExpectError
+ someBy( x, 2, false, {} ); // $ExpectError
+ someBy( x, 2, null, {} ); // $ExpectError
+ someBy( x, 2, [ 1 ], {} ); // $ExpectError
+ someBy( x, 2, {}, {} ); // $ExpectError
+
+ someBy( x, 2, {}, '5' ); // $ExpectError
+ someBy( x, 2, {}, 5 ); // $ExpectError
+ someBy( x, 2, {}, true ); // $ExpectError
+ someBy( x, 2, {}, false ); // $ExpectError
+ someBy( x, 2, {}, null ); // $ExpectError
+ someBy( x, 2, {}, [ 1 ] ); // $ExpectError
+ someBy( x, 2, {}, {} ); // $ExpectError
+
+ someBy( x, 2, {}, '5', {} ); // $ExpectError
+ someBy( x, 2, {}, 5, {} ); // $ExpectError
+ someBy( x, 2, {}, true, {} ); // $ExpectError
+ someBy( x, 2, {}, false, {} ); // $ExpectError
+ someBy( x, 2, {}, null, {} ); // $ExpectError
+ someBy( x, 2, {}, [ 1 ], {} ); // $ExpectError
+ someBy( x, 2, {}, {}, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a `keepdims` option which is not a boolean...
+{
+ const x = zeros( [ 2, 2 ] );
+
+ someBy( x, 2, { 'keepdims': '5' }, clbk ); // $ExpectError
+ someBy( x, 2, { 'keepdims': 5 }, clbk ); // $ExpectError
+ someBy( x, 2, { 'keepdims': null }, clbk ); // $ExpectError
+ someBy( x, 2, { 'keepdims': [ 1 ] }, clbk ); // $ExpectError
+ someBy( x, 2, { 'keepdims': {} }, clbk ); // $ExpectError
+ someBy( x, 2, { 'keepdims': ( x: number ): number => x }, clbk ); // $ExpectError
+
+ someBy( x, 2, { 'keepdims': '5' }, clbk, {} ); // $ExpectError
+ someBy( x, 2, { 'keepdims': 5 }, clbk, {} ); // $ExpectError
+ someBy( x, 2, { 'keepdims': null }, clbk, {} ); // $ExpectError
+ someBy( x, 2, { 'keepdims': [ 1 ] }, clbk, {} ); // $ExpectError
+ someBy( x, 2, { 'keepdims': {} }, clbk, {} ); // $ExpectError
+ someBy( x, 2, { 'keepdims': ( x: number ): number => x }, clbk, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a `dims` option which is not an array of numbers...
+{
+ const x = zeros( [ 2, 2 ] );
+
+ someBy( x, 2, { 'dims': '5' }, clbk ); // $ExpectError
+ someBy( x, 2, { 'dims': 5 }, clbk ); // $ExpectError
+ someBy( x, 2, { 'dims': null }, clbk ); // $ExpectError
+ someBy( x, 2, { 'dims': true }, clbk ); // $ExpectError
+ someBy( x, 2, { 'dims': false }, clbk ); // $ExpectError
+ someBy( x, 2, { 'dims': {} }, clbk ); // $ExpectError
+ someBy( x, 2, { 'dims': ( x: number ): number => x }, clbk ); // $ExpectError
+
+ someBy( x, 2, { 'dims': '5' }, clbk, {} ); // $ExpectError
+ someBy( x, 2, { 'dims': 5 }, clbk, {} ); // $ExpectError
+ someBy( x, 2, { 'dims': null }, clbk, {} ); // $ExpectError
+ someBy( x, 2, { 'dims': true }, clbk, {} ); // $ExpectError
+ someBy( x, 2, { 'dims': false }, clbk, {} ); // $ExpectError
+ someBy( x, 2, { 'dims': {} }, clbk, {} ); // $ExpectError
+ someBy( x, 2, { 'dims': ( x: number ): number => x }, clbk, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const x = zeros( [ 2, 2 ] );
+
+ someBy(); // $ExpectError
+ someBy( x ); // $ExpectError
+ someBy( x, 2 ); // $ExpectError
+ someBy( x, 2, {}, clbk, {}, {} ); // $ExpectError
+}
+
+// Attached to the function is an `assign` method which returns an ndarray...
+{
+ const x = zeros( [ 2, 2 ] );
+ const n = zeros( [], {
+ 'dtype': 'int32'
+ });
+ const y = empty( [], {
+ 'dtype': 'bool'
+ });
+
+ someBy.assign( x, 2, y, clbk ); // $ExpectType boolndarray
+ someBy.assign( x, 2, y, {}, clbk ); // $ExpectType boolndarray
+ someBy.assign( x, 2, y, { 'dims': [ 0 ] }, clbk ); // $ExpectType boolndarray
+
+ someBy.assign( x, 2, y, clbk, {} ); // $ExpectType boolndarray
+ someBy.assign( x, 2, y, {}, clbk, {} ); // $ExpectType boolndarray
+ someBy.assign( x, 2, y, { 'dims': [ 0 ] }, clbk, {} ); // $ExpectType boolndarray
+
+ someBy.assign( x, n, y, clbk ); // $ExpectType boolndarray
+ someBy.assign( x, n, y, {}, clbk ); // $ExpectType boolndarray
+ someBy.assign( x, n, y, { 'dims': [ 0 ] }, clbk ); // $ExpectType boolndarray
+
+ someBy.assign( x, n, y, clbk, {} ); // $ExpectType boolndarray
+ someBy.assign( x, n, y, {}, clbk, {} ); // $ExpectType boolndarray
+ someBy.assign( x, n, y, { 'dims': [ 0 ] }, clbk, {} ); // $ExpectType boolndarray
+}
+
+// The compiler throws an error if the `assign` method is provided a first argument which is not an ndarray...
+{
+ const y = empty( [], {
+ 'dtype': 'bool'
+ });
+
+ someBy.assign( 5, 2, y, clbk ); // $ExpectError
+ someBy.assign( true, 2, y, clbk ); // $ExpectError
+ someBy.assign( false, 2, y, clbk ); // $ExpectError
+ someBy.assign( null, 2, y, clbk ); // $ExpectError
+ someBy.assign( undefined, 2, y, clbk ); // $ExpectError
+ someBy.assign( {}, 2, y, clbk ); // $ExpectError
+ someBy.assign( [ 1 ], 2, y, clbk ); // $ExpectError
+ someBy.assign( ( x: number ): number => x, 2, y, clbk ); // $ExpectError
+
+ someBy.assign( 5, 2, y, {}, clbk ); // $ExpectError
+ someBy.assign( true, 2, y, {}, clbk ); // $ExpectError
+ someBy.assign( false, 2, y, {}, clbk ); // $ExpectError
+ someBy.assign( null, 2, y, {}, clbk ); // $ExpectError
+ someBy.assign( undefined, 2, y, {}, clbk ); // $ExpectError
+ someBy.assign( {}, 2, y, {}, clbk ); // $ExpectError
+ someBy.assign( [ 1 ], 2, y, {}, clbk ); // $ExpectError
+ someBy.assign( ( x: number ): number => x, 2, y, {}, clbk ); // $ExpectError
+
+ someBy.assign( 5, 2, y, clbk, {} ); // $ExpectError
+ someBy.assign( true, 2, y, clbk, {} ); // $ExpectError
+ someBy.assign( false, 2, y, clbk, {} ); // $ExpectError
+ someBy.assign( null, 2, y, clbk, {} ); // $ExpectError
+ someBy.assign( undefined, 2, y, clbk, {} ); // $ExpectError
+ someBy.assign( {}, 2, y, clbk, {} ); // $ExpectError
+ someBy.assign( [ 1 ], 2, y, clbk, {} ); // $ExpectError
+ someBy.assign( ( x: number ): number => x, 2, y, clbk, {} ); // $ExpectError
+
+ someBy.assign( 5, 2, y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( true, 2, y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( false, 2, y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( null, 2, y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( undefined, 2, y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( {}, 2, y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( [ 1 ], 2, y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( ( x: number ): number => x, 2, y, {}, clbk, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided a second argument which is not an integer ndarray or a number...
+{
+ const x = zeros( [ 2, 2 ] );
+ const y = empty( [], {
+ 'dtype': 'bool'
+ });
+
+ someBy.assign( x, '5', y, clbk ); // $ExpectError
+ someBy.assign( x, true, y, clbk ); // $ExpectError
+ someBy.assign( x, false, y, clbk ); // $ExpectError
+ someBy.assign( x, null, y, clbk ); // $ExpectError
+ someBy.assign( x, undefined, y, clbk ); // $ExpectError
+ someBy.assign( x, {}, y, clbk ); // $ExpectError
+ someBy.assign( x, [ 1 ], y, clbk ); // $ExpectError
+ someBy.assign( x, ( x: number ): number => x, y, clbk ); // $ExpectError
+
+ someBy.assign( x, '5', y, {}, clbk ); // $ExpectError
+ someBy.assign( x, true, y, {}, clbk ); // $ExpectError
+ someBy.assign( x, false, y, {}, clbk ); // $ExpectError
+ someBy.assign( x, null, y, {}, clbk ); // $ExpectError
+ someBy.assign( x, undefined, y, {}, clbk ); // $ExpectError
+ someBy.assign( x, {}, y, {}, clbk ); // $ExpectError
+ someBy.assign( x, [ 1 ], y, {}, clbk ); // $ExpectError
+ someBy.assign( x, ( x: number ): number => x, y, {}, clbk ); // $ExpectError
+
+ someBy.assign( x, '5', y, clbk, {} ); // $ExpectError
+ someBy.assign( x, true, y, clbk, {} ); // $ExpectError
+ someBy.assign( x, false, y, clbk, {} ); // $ExpectError
+ someBy.assign( x, null, y, clbk, {} ); // $ExpectError
+ someBy.assign( x, undefined, y, clbk, {} ); // $ExpectError
+ someBy.assign( x, {}, y, clbk, {} ); // $ExpectError
+ someBy.assign( x, [ 1 ], y, clbk, {} ); // $ExpectError
+ someBy.assign( x, ( x: number ): number => x, y, clbk, {} ); // $ExpectError
+
+ someBy.assign( x, '5', y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, true, y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, false, y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, null, y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, undefined, y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, {}, y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, [ 1 ], y, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, ( x: number ): number => x, y, {}, clbk, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided an output argument which is not an ndarray...
+{
+ const x = zeros( [ 2, 2 ] );
+
+ someBy.assign( x, 2, 5, clbk ); // $ExpectError
+ someBy.assign( x, 2, true, clbk ); // $ExpectError
+ someBy.assign( x, 2, false, clbk ); // $ExpectError
+ someBy.assign( x, 2, null, clbk ); // $ExpectError
+ someBy.assign( x, 2, undefined, clbk ); // $ExpectError
+ someBy.assign( x, 2, {}, clbk ); // $ExpectError
+ someBy.assign( x, 2, [ 1 ], clbk ); // $ExpectError
+ someBy.assign( x, 2, ( x: number ): number => x, clbk ); // $ExpectError
+
+ someBy.assign( x, 2, 5, {}, clbk ); // $ExpectError
+ someBy.assign( x, 2, true, {}, clbk ); // $ExpectError
+ someBy.assign( x, 2, false, {}, clbk ); // $ExpectError
+ someBy.assign( x, 2, null, {}, clbk ); // $ExpectError
+ someBy.assign( x, 2, undefined, {}, clbk ); // $ExpectError
+ someBy.assign( x, 2, {}, {}, clbk ); // $ExpectError
+ someBy.assign( x, 2, [ 1 ], {}, clbk ); // $ExpectError
+ someBy.assign( x, 2, ( x: number ): number => x, {}, clbk ); // $ExpectError
+
+ someBy.assign( x, 2, 5, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, true, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, false, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, null, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, undefined, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, [ 1 ], clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, ( x: number ): number => x, clbk, {} ); // $ExpectError
+
+ someBy.assign( x, 2, 5, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, true, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, false, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, null, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, undefined, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, {}, {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, [ 1 ], {}, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, ( x: number ): number => x, {}, clbk, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided an options argument which is not an object...
+{
+ const x = zeros( [ 2, 2 ] );
+ const y = empty( [], {
+ 'dtype': 'bool'
+ });
+
+ someBy.assign( x, 2, y, '5', clbk ); // $ExpectError
+ someBy.assign( x, 2, y, 5, clbk ); // $ExpectError
+ someBy.assign( x, 2, y, true, clbk ); // $ExpectError
+ someBy.assign( x, 2, y, false, clbk ); // $ExpectError
+ someBy.assign( x, 2, y, null, clbk ); // $ExpectError
+ someBy.assign( x, 2, y, [ 1 ], clbk ); // $ExpectError
+ someBy.assign( x, 2, y, ( x: number ): number => x, clbk ); // $ExpectError
+
+ someBy.assign( x, 2, y, '5', clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, y, 5, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, y, true, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, y, false, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, y, null, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, y, [ 1 ], clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, y, ( x: number ): number => x, clbk, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided a callback argument which is not a function...
+{
+ const x = zeros( [ 2, 2 ] );
+ const y = empty( [], {
+ 'dtype': 'int32'
+ });
+
+ someBy.assign( x, 2, y, '5' ); // $ExpectError
+ someBy.assign( x, 2, y, 5 ); // $ExpectError
+ someBy.assign( x, 2, y, true ); // $ExpectError
+ someBy.assign( x, 2, y, false ); // $ExpectError
+ someBy.assign( x, 2, y, null ); // $ExpectError
+ someBy.assign( x, 2, y, [ 1 ] ); // $ExpectError
+ someBy.assign( x, 2, y, {} ); // $ExpectError
+
+ someBy.assign( x, 2, y, '5', {} ); // $ExpectError
+ someBy.assign( x, 2, y, 5, {} ); // $ExpectError
+ someBy.assign( x, 2, y, true, {} ); // $ExpectError
+ someBy.assign( x, 2, y, false, {} ); // $ExpectError
+ someBy.assign( x, 2, y, null, {} ); // $ExpectError
+ someBy.assign( x, 2, y, [ 1 ], {} ); // $ExpectError
+ someBy.assign( x, 2, y, {}, {} ); // $ExpectError
+
+ someBy.assign( x, 2, y, {}, '5' ); // $ExpectError
+ someBy.assign( x, 2, y, {}, 5 ); // $ExpectError
+ someBy.assign( x, 2, y, {}, true ); // $ExpectError
+ someBy.assign( x, 2, y, {}, false ); // $ExpectError
+ someBy.assign( x, 2, y, {}, null ); // $ExpectError
+ someBy.assign( x, 2, y, {}, [ 1 ] ); // $ExpectError
+ someBy.assign( x, 2, y, {}, {} ); // $ExpectError
+
+ someBy.assign( x, 2, y, {}, '5', {} ); // $ExpectError
+ someBy.assign( x, 2, y, {}, 5, {} ); // $ExpectError
+ someBy.assign( x, 2, y, {}, true, {} ); // $ExpectError
+ someBy.assign( x, 2, y, {}, false, {} ); // $ExpectError
+ someBy.assign( x, 2, y, {}, null, {} ); // $ExpectError
+ someBy.assign( x, 2, y, {}, [ 1 ], {} ); // $ExpectError
+ someBy.assign( x, 2, y, {}, {}, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a `dims` option which is not an array of numbers...
+{
+ const x = zeros( [ 2, 2 ] );
+ const y = empty( [], {
+ 'dtype': 'bool'
+ });
+
+ someBy.assign( x, 2, y, { 'dims': '5' }, clbk ); // $ExpectError
+ someBy.assign( x, 2, y, { 'dims': 5 }, clbk ); // $ExpectError
+ someBy.assign( x, 2, y, { 'dims': null }, clbk ); // $ExpectError
+ someBy.assign( x, 2, y, { 'dims': true }, clbk ); // $ExpectError
+ someBy.assign( x, 2, y, { 'dims': false }, clbk ); // $ExpectError
+ someBy.assign( x, 2, y, { 'dims': {} }, clbk ); // $ExpectError
+ someBy.assign( x, 2, y, { 'dims': ( x: number ): number => x }, clbk ); // $ExpectError
+
+ someBy.assign( x, 2, y, { 'dims': '5' }, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, y, { 'dims': 5 }, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, y, { 'dims': null }, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, y, { 'dims': true }, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, y, { 'dims': false }, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, y, { 'dims': {} }, clbk, {} ); // $ExpectError
+ someBy.assign( x, 2, y, { 'dims': ( x: number ): number => x }, clbk, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const x = zeros( [ 2, 2 ] );
+ const y = empty( [], {
+ 'dtype': 'bool'
+ });
+
+ someBy.assign(); // $ExpectError
+ someBy.assign( x ); // $ExpectError
+ someBy.assign( x, 2, y ); // $ExpectError
+ someBy.assign( x, 2, y, {}, clbk, {}, {} ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/examples/index.js b/lib/node_modules/@stdlib/ndarray/some-by/examples/index.js
new file mode 100644
index 000000000000..dc63278b8c26
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/examples/index.js
@@ -0,0 +1,39 @@
+/**
+* @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/base/discrete-uniform' ).factory;
+var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
+var fillBy = require( '@stdlib/ndarray/fill-by' );
+var zeros = require( '@stdlib/ndarray/zeros' );
+var someBy = require( './../lib' );
+
+var x = zeros( [ 2, 4, 5 ], {
+ 'dtype': 'float64'
+});
+x = fillBy( x, discreteUniform( 0, 10 ) );
+console.log( ndarray2array( x ) );
+
+var n = scalar2ndarray( 4, {
+ 'dtype': 'int8'
+});
+var y = someBy( x, n, isEven );
+console.log( y.get() );
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/lib/assign.js b/lib/node_modules/@stdlib/ndarray/some-by/lib/assign.js
new file mode 100644
index 000000000000..22f7a2d57afa
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/lib/assign.js
@@ -0,0 +1,190 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var isFunction = require( '@stdlib/assert/is-function' );
+var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
+var isIntegerDataType = require( '@stdlib/ndarray/base/assert/is-integer-data-type' );
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var unaryReduceSubarrayBy = require( '@stdlib/ndarray/base/unary-reduce-subarray-by' );
+var ndims = require( '@stdlib/ndarray/ndims' );
+var base = require( '@stdlib/ndarray/base/some-by' );
+var getDtype = require( '@stdlib/ndarray/dtype' );
+var getShape = require( '@stdlib/ndarray/shape' ); // note: non-base accessor is intentional due to the input arrays originating in userland
+var getOrder = require( '@stdlib/ndarray/base/order' );
+var defaults = require( '@stdlib/ndarray/defaults' );
+var maybeBroadcastArray = require( '@stdlib/ndarray/base/maybe-broadcast-array' );
+var broadcastScalar = require( '@stdlib/ndarray/base/broadcast-scalar' );
+var objectAssign = require( '@stdlib/object/assign' );
+var zeroTo = require( '@stdlib/array/base/zero-to' );
+var format = require( '@stdlib/string/format' );
+var DEFAULTS = require( './defaults.json' );
+var validate = require( './validate.js' );
+
+
+// VARIABLES //
+
+var DEFAULT_DTYPE = defaults.get( 'dtypes.integer_index' );
+
+
+// MAIN //
+
+/**
+* Tests whether at least `n` elements along one or more ndarray dimensions pass a test implemented by a predicate function.
+*
+* @param {ndarray} x - input ndarray
+* @param {(ndarray|integer)} n - number of elements which must pass the test
+* @param {ndarray} y - output ndarray
+* @param {Options} [options] - function options
+* @param {IntegerArray} [options.dims] - list of dimensions over which to perform a reduction
+* @param {Function} predicate - predicate function
+* @param {*} [thisArg] - predicate execution context
+* @throws {TypeError} first argument must be an ndarray-like object
+* @throws {Error} second argument must be broadcast-compatible with the non-reduced dimensions of the input ndarray
+* @throws {TypeError} third argument must be an ndarray-like object
+* @throws {TypeError} options argument must be an object
+* @throws {TypeError} callback argument must be a function
+* @throws {Error} must provide valid options
+* @returns {ndarray} output ndarray
+*
+* @example
+* var Float64Array = require( '@stdlib/array/float64' );
+* var ndarray = require( '@stdlib/ndarray/ctor' );
+* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
+* var empty = require( '@stdlib/ndarray/empty' );
+*
+* // Create a data buffer:
+* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
+*
+* // Define the shape of the input array:
+* var shape = [ 3, 1, 2 ];
+*
+* // Define the array strides:
+* var sx = [ 4, 4, 1 ];
+*
+* // Define the index offset:
+* var ox = 1;
+*
+* // Create an input ndarray:
+* var x = new ndarray( 'float64', xbuf, shape, sx, ox, 'row-major' );
+*
+* // Create an output ndarray:
+* var y = empty( [], {
+* 'dtype': 'bool'
+* });
+*
+* // Perform reduction:
+* var out = assign( x, 3, y, isEven );
+* // returns
+*
+* var v = out.get();
+* // returns true
+*/
+function assign( x, n, y, options, predicate, thisArg ) {
+ var nargs;
+ var opts;
+ var err;
+ var ord;
+ var flg;
+ var ctx;
+ var cb;
+ var N;
+ var v;
+ var o;
+
+ nargs = arguments.length;
+ if ( !isndarrayLike( x ) ) {
+ throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );
+ }
+ if ( !isndarrayLike( y ) ) {
+ throw new TypeError( format( 'invalid argument. Third argument must be an ndarray-like object. Value: `%s`.', y ) );
+ }
+ // Case: assign( x, n, y, predicate )
+ if ( nargs < 5 ) {
+ cb = options;
+ if ( !isFunction( cb ) ) {
+ throw new TypeError( format( 'invalid argument. Fourth argument must be a function. Value: `%s`.', cb ) );
+ }
+ }
+ // Case: assign( x, n, y, options, predicate, thisArg )
+ else if ( nargs > 5 ) {
+ flg = true;
+ o = options;
+ cb = predicate;
+ if ( !isFunction( cb ) ) {
+ throw new TypeError( format( 'invalid argument. Fifth argument must be a function. Value: `%s`.', cb ) );
+ }
+ ctx = thisArg;
+ }
+ // Case: assign( x, n, y, predicate, thisArg )
+ else if ( isFunction( options ) ) {
+ cb = options;
+ ctx = predicate;
+ }
+ // Case: assign( x, n, y, options, predicate )
+ else if ( isFunction( predicate ) ) {
+ flg = true;
+ o = options;
+ cb = predicate;
+ }
+ // Case: assign( x, n, y, ???, ??? )
+ else {
+ throw new TypeError( format( 'invalid argument. Fifth argument must be a function. Value: `%s`.', predicate ) );
+ }
+ N = ndims( x );
+ opts = objectAssign( {}, DEFAULTS );
+ if ( flg ) {
+ err = validate( opts, N, o );
+ if ( err ) {
+ throw err;
+ }
+ }
+ // When a list of dimensions is not provided, reduce the entire input array across all dimensions...
+ if ( opts.dims === null ) {
+ opts.dims = zeroTo( N );
+ }
+ // Resolve input array meta data:
+ ord = getOrder( x );
+
+ if ( isndarrayLike( n ) ) {
+ if ( isIntegerDataType( getDtype( n ) ) ) {
+ throw new TypeError( format( 'invalid argument. Second argument must have an integer data type. Value: `%s`.', n ) );
+ }
+ try {
+ v = maybeBroadcastArray( n, getShape( y ) );
+ } catch ( err ) { // eslint-disable-line no-unused-vars
+ throw new Error( 'invalid argument. Second argument must be broadcast-compatible with the non-reduced dimensions of the input array.' );
+ }
+ } else {
+ if ( !isInteger( n ) ) {
+ throw new TypeError( format( 'invalid argument. Second argument must be an integer or an ndarray-like object. Value: `%s`.', n ) );
+ }
+ v = broadcastScalar( n, DEFAULT_DTYPE, getShape( y ), ord );
+ }
+ // Perform the reduction:
+ unaryReduceSubarrayBy( base, [ x, y, v ], opts.dims, cb, ctx ); // note: we assume that this lower-level function handles further validation of the output ndarray (e.g., expected shape, etc)
+ return y;
+}
+
+
+// EXPORTS //
+
+module.exports = assign;
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/lib/defaults.json b/lib/node_modules/@stdlib/ndarray/some-by/lib/defaults.json
new file mode 100644
index 000000000000..08433b373a0e
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/lib/defaults.json
@@ -0,0 +1,4 @@
+{
+ "dims": null,
+ "keepdims": false
+}
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/lib/index.js b/lib/node_modules/@stdlib/ndarray/some-by/lib/index.js
new file mode 100644
index 000000000000..f386757770a5
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/lib/index.js
@@ -0,0 +1,103 @@
+/**
+* @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';
+
+/**
+* Test whether at least `n` elements along one or more ndarray dimensions pass a test implemented by a predicate function.
+*
+* @module @stdlib/ndarray/some-by
+*
+* @example
+* var Float64Array = require( '@stdlib/array/float64' );
+* var ndarray = require( '@stdlib/ndarray/ctor' );
+* var someBy = require( '@stdlib/ndarray/some-by' );
+*
+* // Create a data buffer:
+* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
+*
+* // Define the shape of the input array:
+* var sh = [ 3, 1, 2 ];
+*
+* // Define the array strides:
+* var sx = [ 4, 4, 1 ];
+*
+* // Define the index offset:
+* var ox = 1;
+*
+* // Create an input ndarray:
+* var x = new ndarray( 'float64', xbuf, sh, sx, ox, 'row-major' );
+*
+* // Perform reduction:
+* var out = someBy( x, 6 );
+* // returns
+*
+* var v = out.get();
+* // returns true
+*
+* @example
+* var Float64Array = require( '@stdlib/array/float64' );
+* var ndarray = require( '@stdlib/ndarray/ctor' );
+* var empty = require( '@stdlib/ndarray/empty' );
+* var someBy = require( '@stdlib/ndarray/some-by' );
+*
+* // Create a data buffer:
+* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
+*
+* // Define the shape of the input array:
+* var shape = [ 3, 1, 2 ];
+*
+* // Define the array strides:
+* var sx = [ 4, 4, 1 ];
+*
+* // Define the index offset:
+* var ox = 1;
+*
+* // Create an input ndarray:
+* var x = new ndarray( 'float64', xbuf, shape, sx, ox, 'row-major' );
+*
+* // Create an output ndarray:
+* var y = empty( [], {
+* 'dtype': 'bool'
+* });
+*
+* // Perform reduction:
+* var out = someBy.assign( x, 6.0, y );
+* // returns
+*
+* var v = out.get();
+* // 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;
+
+// exports: { "assign": "main.assign" }
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/lib/main.js b/lib/node_modules/@stdlib/ndarray/some-by/lib/main.js
new file mode 100644
index 000000000000..8c9dd90276e4
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/lib/main.js
@@ -0,0 +1,217 @@
+/**
+* @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 isFunction = require( '@stdlib/assert/is-function' );
+var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var isIntegerDataType = require( '@stdlib/ndarray/base/assert/is-integer-data-type' );
+var unaryReduceSubarrayBy = require( '@stdlib/ndarray/base/unary-reduce-subarray-by' );
+var base = require( '@stdlib/ndarray/base/some-by' );
+var spreadDimensions = require( '@stdlib/ndarray/base/spread-dimensions' );
+var indicesComplement = require( '@stdlib/array/base/indices-complement' );
+var getDtype = require( '@stdlib/ndarray/dtype' );
+var getShape = require( '@stdlib/ndarray/shape' ); // note: non-base accessor is intentional due to the input array originating in userland
+var getOrder = require( '@stdlib/ndarray/base/order' );
+var getData = require( '@stdlib/ndarray/base/data-buffer' );
+var getStrides = require( '@stdlib/ndarray/base/strides' );
+var getOffset = require( '@stdlib/ndarray/base/offset' );
+var defaults = require( '@stdlib/ndarray/defaults' );
+var empty = require( '@stdlib/ndarray/empty' );
+var ndarrayCtor = require( '@stdlib/ndarray/base/ctor' );
+var maybeBroadcastArray = require( '@stdlib/ndarray/base/maybe-broadcast-array' );
+var broadcastScalar = require( '@stdlib/ndarray/base/broadcast-scalar' );
+var reinterpretBoolean = require( '@stdlib/strided/base/reinterpret-boolean' );
+var takeIndexed = require( '@stdlib/array/base/take-indexed' );
+var zeroTo = require( '@stdlib/array/base/zero-to' );
+var objectAssign = require( '@stdlib/object/assign' );
+var format = require( '@stdlib/string/format' );
+var DEFAULTS = require( './defaults.json' );
+var validate = require( './validate.js' );
+
+
+// VARIABLES //
+
+var DEFAULT_DTYPE = defaults.get( 'dtypes.integer_index' );
+
+
+// MAIN //
+
+/**
+* Tests whether at least `n` elements along one or more ndarray dimensions pass a test implemented by a predicate function.
+*
+* @param {ndarray} x - input ndarray
+* @param {(ndarray|integer)} n - number of elements which must pass a test
+* @param {Options} [options] - function options
+* @param {IntegerArray} [options.dims] - list of dimensions over which to perform a reduction
+* @param {boolean} [options.keepdims=false] - boolean indicating whether the reduced dimensions should be included in the returned ndarray as singleton dimensions
+* @param {Function} predicate - predicate function
+* @param {*} [thisArg] - predicate function execution context
+* @throws {TypeError} first argument must be an ndarray-like object
+* @throws {TypeError} second argument must be an ndarray-like object or a scalar value
+* @throws {TypeError} options argument must be an object
+* @throws {TypeError} callback argument must be a function
+* @throws {RangeError} dimension indices must not exceed input ndarray bounds
+* @throws {RangeError} number of dimension indices must not exceed the number of input ndarray dimensions
+* @throws {Error} must provide valid options
+* @returns {ndarray} output ndarray
+*
+* @example
+* var Float64Array = require( '@stdlib/array/float64' );
+* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
+* var ndarray = require( '@stdlib/ndarray/ctor' );
+*
+* // Create a data buffer:
+* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
+*
+* // Define the shape of the input array:
+* var sh = [ 3, 1, 2 ];
+*
+* // Define the array strides:
+* var sx = [ 4, 4, 1 ];
+*
+* // Define the index offset:
+* var ox = 1;
+*
+* // Create an input ndarray:
+* var x = new ndarray( 'float64', xbuf, sh, sx, ox, 'row-major' );
+*
+* // Perform reduction:
+* var out = someBy( x, 3, isEven );
+* // returns
+*
+* var v = out.get();
+* // returns true
+*/
+function someBy( x, n, options, predicate, thisArg ) {
+ var nargs;
+ var opts;
+ var view;
+ var ctx;
+ var err;
+ var idx;
+ var shx;
+ var shy;
+ var ord;
+ var flg;
+ var cb;
+ var N;
+ var v;
+ var y;
+ var o;
+
+ nargs = arguments.length;
+ if ( !isndarrayLike( x ) ) {
+ throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );
+ }
+ // Case: someBy( x, n, predicate )
+ if ( nargs < 4 ) {
+ if ( !isFunction( options ) ) {
+ throw new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', options ) );
+ }
+ cb = options;
+ }
+ // Case: someBy( x, n, options, predicate, thisArg )
+ else if ( nargs > 4 ) {
+ flg = true;
+ o = options;
+ cb = predicate;
+ if ( !isFunction( cb ) ) {
+ throw new TypeError( format( 'invalid argument. Fourth argument must be a function. Value: `%s`.', cb ) );
+ }
+ ctx = thisArg;
+ }
+ // Case: someBy( x, n, predicate, thisArg )
+ else if ( isFunction( options ) ) {
+ cb = options;
+ ctx = predicate;
+ }
+ // Case: someBy( x, n, options, predicate )
+ else if ( isFunction( predicate ) ) {
+ flg = true;
+ o = options;
+ cb = predicate;
+ }
+ // Case: someBy( x, n, ???, ??? )
+ else {
+ throw new TypeError( format( 'invalid argument. Fourth argument must be a function. Value: `%s`.', predicate ) );
+ }
+ shx = getShape( x );
+ N = shx.length;
+
+ opts = objectAssign( {}, DEFAULTS );
+ if ( flg ) {
+ err = validate( opts, N, o );
+ if ( err ) {
+ throw err;
+ }
+ }
+ // When a list of dimensions is not provided, reduce the entire input array across all dimensions...
+ if ( opts.dims === null ) {
+ opts.dims = zeroTo( N );
+ }
+ // Resolve the list of non-reduced dimensions:
+ idx = indicesComplement( N, opts.dims );
+
+ // Resolve the output array shape:
+ shy = takeIndexed( shx, idx );
+
+ // Resolve input array meta data:
+ ord = getOrder( x );
+
+ if ( isndarrayLike( n ) ) {
+ if ( !isIntegerDataType( getDtype( n ) ) ) {
+ throw new TypeError( format( 'invalid argument. Second argument must have an integer data type. Value: `%s`.', n ) );
+ }
+ try {
+ v = maybeBroadcastArray( n, shy );
+ } catch ( err ) { // eslint-disable-line no-unused-vars
+ throw new Error( 'invalid argument. Second argument must be broadcast-compatible with the non-reduced dimensions of the input array.' );
+ }
+ } else {
+ if ( !isInteger( n ) ) {
+ throw new TypeError( format( 'invalid argument. Second argument must be an integer or an ndarray-like object. Value: `%s`.', n ) );
+ }
+ v = broadcastScalar( n, DEFAULT_DTYPE, shy, ord );
+ }
+ // Initialize an output array whose shape matches that of the non-reduced dimensions and which has the same memory layout as the input array:
+ y = empty( shy, {
+ 'dtype': 'bool',
+ 'order': ord
+ });
+
+ // Reinterpret the output array as an "indexed" array to ensure faster element access:
+ view = new ndarrayCtor( 'uint8', reinterpretBoolean( getData( y ), 0 ), shy, getStrides( y, false ), getOffset( y ), getOrder( y ) );
+
+ // Perform the reduction:
+ unaryReduceSubarrayBy( base, [ x, view, v ], opts.dims, cb, ctx );
+
+ // Check whether we need to reinsert singleton dimensions which can be useful for broadcasting the returned output array to the shape of the original input array...
+ if ( opts.keepdims ) {
+ y = spreadDimensions( N, y, idx );
+ }
+ return y;
+}
+
+
+// EXPORTS //
+
+module.exports = someBy;
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/lib/validate.js b/lib/node_modules/@stdlib/ndarray/some-by/lib/validate.js
new file mode 100644
index 000000000000..3a1f3837df22
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/lib/validate.js
@@ -0,0 +1,90 @@
+/**
+* @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 isObject = require( '@stdlib/assert/is-plain-object' );
+var hasOwnProp = require( '@stdlib/assert/has-own-property' );
+var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
+var isIntegerArray = require( '@stdlib/assert/is-integer-array' ).primitives;
+var isEmptyCollection = require( '@stdlib/assert/is-empty-collection' );
+var normalizeIndices = require( '@stdlib/ndarray/base/to-unique-normalized-indices' );
+var join = require( '@stdlib/array/base/join' );
+var format = require( '@stdlib/string/format' );
+
+
+// MAIN //
+
+/**
+* Validates function options.
+*
+* @private
+* @param {Object} opts - destination object
+* @param {NonNegativeInteger} ndims - number of input ndarray dimensions
+* @param {Options} options - function options
+* @param {boolean} [options.keepdims] - boolean indicating whether the reduced dimensions should be included in the returned ndarray as singleton dimensions
+* @param {IntegerArray} [options.dims] - list of dimensions over which to perform a reduction
+* @returns {(Error|null)} null or an error object
+*
+* @example
+* var opts = {};
+* var options = {
+* 'keepdims': true
+* };
+* var err = validate( opts, 3, options );
+* if ( err ) {
+* throw err;
+* }
+*/
+function validate( opts, ndims, options ) {
+ var tmp;
+ if ( !isObject( options ) ) {
+ return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
+ }
+ if ( hasOwnProp( options, 'keepdims' ) ) {
+ opts.keepdims = options.keepdims;
+ if ( !isBoolean( opts.keepdims ) ) {
+ return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'keepdims', opts.keepdims ) );
+ }
+ }
+ if ( hasOwnProp( options, 'dims' ) ) {
+ opts.dims = options.dims;
+ if ( !isIntegerArray( opts.dims ) && !isEmptyCollection( opts.dims ) ) {
+ return new TypeError( format( 'invalid option. `%s` option must be an array of integers. Option: `%s`.', 'dims', opts.dims ) );
+ }
+ tmp = normalizeIndices( opts.dims, ndims-1 );
+ if ( tmp === null ) {
+ return new RangeError( format( 'invalid option. `%s` option contains an out-of-bounds dimension index. Option: [%s].', 'dims', join( opts.dims, ',' ) ) );
+ }
+ if ( tmp.length !== opts.dims.length ) {
+ return new Error( format( 'invalid option. `%s` option contains duplicate indices. Option: [%s].', 'dims', join( opts.dims, ',' ) ) );
+ }
+ if ( tmp.length > ndims ) {
+ return new RangeError( format( 'invalid option. `%s` option specifies more dimensions than exists in the input array. Number of dimensions: %d. Option: [%s].', ndims, join( opts.dims, ',' ) ) );
+ }
+ opts.dims = tmp;
+ }
+ return null;
+}
+
+
+// EXPORTS //
+
+module.exports = validate;
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/package.json b/lib/node_modules/@stdlib/ndarray/some-by/package.json
new file mode 100644
index 000000000000..8528f01efbae
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/package.json
@@ -0,0 +1,66 @@
+{
+ "name": "@stdlib/ndarray/some-by",
+ "version": "0.0.0",
+ "description": "Test whether at least `n` elements along one or more ndarray dimensions pass a test implemented by a predicate 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",
+ "strided",
+ "array",
+ "ndarray",
+ "every",
+ "some",
+ "all",
+ "utility",
+ "utils",
+ "truthy",
+ "reduce",
+ "reduction"
+ ],
+ "__stdlib__": {}
+}
diff --git a/lib/node_modules/@stdlib/ndarray/some-by/test/test.js b/lib/node_modules/@stdlib/ndarray/some-by/test/test.js
new file mode 100644
index 000000000000..2d2917d3a951
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/some-by/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 isMethod = require( '@stdlib/assert/is-method' );
+var someBy = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof someBy, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'attached to the main export is an `assign` method', function test( t ) {
+ t.strictEqual( isMethod( someBy, 'assign' ), true, 'returns expected value' );
+ t.end();
+});
+
+// TODO: add tests