From a784599d2ee0d52b384fe3aa741ece469866b591 Mon Sep 17 00:00:00 2001 From: MANDEep22332 Date: Wed, 18 Mar 2026 08:25:47 +0000 Subject: [PATCH 1/8] fix: replace new Array() with array literals to fix lint errors --- .../@stdlib/assert/is-biguint64array/examples/index.js | 4 +++- .../math/strided/special/acoversin-by/test/test.main.js | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-biguint64array/examples/index.js b/lib/node_modules/@stdlib/assert/is-biguint64array/examples/index.js index b3232562f791..d6fe13b842b7 100644 --- a/lib/node_modules/@stdlib/assert/is-biguint64array/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-biguint64array/examples/index.js @@ -74,7 +74,9 @@ bool = isBigUint64Array( new Float32Array( 10 ) ); console.error( bool ); // => false -bool = isBigUint64Array( new Array( 10 ) ); +var arr = []; +arr.push( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ); +bool = isBigUint64Array( arr ); console.error( bool ); // => false diff --git a/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js b/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js index 34e5907d4656..0b23a9e6650e 100644 --- a/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js +++ b/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js @@ -74,7 +74,8 @@ tape( 'the function computes the inverse coversed sine via a callback function', acoversinBy( x.length, x, 1, y, 1, accessor ); t.deepEqual( y, expected, 'deep equal' ); - x = new Array( 5 ); // sparse array + x = [ , , , , ]; // eslint-disable-line no-sparse-arrays + x.length(5); y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; expected = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; @@ -82,7 +83,8 @@ tape( 'the function computes the inverse coversed sine via a callback function', acoversinBy( x.length, x, 1, y, 1, accessor ); t.deepEqual( y, expected, 'deep equal' ); - x = new Array( 5 ); // sparse array + x = [ , , , , ]; // eslint-disable-line no-sparse-arrays + x.length(5); x[ 2 ] = rand(); y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; From e44c040879d7c4c2c459aa361712bc1d22d2d37d Mon Sep 17 00:00:00 2001 From: MANDEep22332 Date: Wed, 18 Mar 2026 08:57:02 +0000 Subject: [PATCH 2/8] fix: replace new Array() with array literals to fix lint errors --- .../math/strided/special/acoversin-by/test/test.main.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js b/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js index 0b23a9e6650e..836dae996ffa 100644 --- a/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js +++ b/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js @@ -75,7 +75,6 @@ tape( 'the function computes the inverse coversed sine via a callback function', t.deepEqual( y, expected, 'deep equal' ); x = [ , , , , ]; // eslint-disable-line no-sparse-arrays - x.length(5); y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; expected = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; @@ -84,7 +83,7 @@ tape( 'the function computes the inverse coversed sine via a callback function', t.deepEqual( y, expected, 'deep equal' ); x = [ , , , , ]; // eslint-disable-line no-sparse-arrays - x.length(5); + x[ 2 ] = rand(); y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; From 213e2b3597089b68e9990c88a2ddee75e66bb124 Mon Sep 17 00:00:00 2001 From: MANDEep22332 Date: Wed, 18 Mar 2026 09:05:49 +0000 Subject: [PATCH 3/8] fix: use Array.from for sparse arrays to fix lint errors --- .../special/acoversin-by/test/test.main.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js b/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js index 836dae996ffa..39c97d5f0edc 100644 --- a/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js +++ b/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js @@ -74,17 +74,16 @@ tape( 'the function computes the inverse coversed sine via a callback function', acoversinBy( x.length, x, 1, y, 1, accessor ); t.deepEqual( y, expected, 'deep equal' ); - x = [ , , , , ]; // eslint-disable-line no-sparse-arrays - y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; - - expected = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + x = Array.from( { 'length': 5 } ); // sparse array +y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; - acoversinBy( x.length, x, 1, y, 1, accessor ); - t.deepEqual( y, expected, 'deep equal' ); +expected = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; - x = [ , , , , ]; // eslint-disable-line no-sparse-arrays +acoversinBy( x.length, x, 1, y, 1, accessor ); +t.deepEqual( y, expected, 'deep equal' ); - x[ 2 ] = rand(); +x = Array.from( { 'length': 5 } ); // sparse array +x[ 2 ] = rand(); y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; expected = y.slice(); From 78c6a887e738610d9b5f5ee84e6529af61f07b18 Mon Sep 17 00:00:00 2001 From: MANDEep22332 Date: Wed, 18 Mar 2026 09:13:48 +0000 Subject: [PATCH 4/8] fix: use array literal with length property for sparse arrays --- .../special/acoversin-by/test/test.main.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js b/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js index 39c97d5f0edc..93db498e45ff 100644 --- a/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js +++ b/lib/node_modules/@stdlib/math/strided/special/acoversin-by/test/test.main.js @@ -74,16 +74,18 @@ tape( 'the function computes the inverse coversed sine via a callback function', acoversinBy( x.length, x, 1, y, 1, accessor ); t.deepEqual( y, expected, 'deep equal' ); - x = Array.from( { 'length': 5 } ); // sparse array -y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + x = []; // sparse array + x.length = 5; + y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; -expected = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; + expected = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; -acoversinBy( x.length, x, 1, y, 1, accessor ); -t.deepEqual( y, expected, 'deep equal' ); + acoversinBy( x.length, x, 1, y, 1, accessor ); + t.deepEqual( y, expected, 'deep equal' ); -x = Array.from( { 'length': 5 } ); // sparse array -x[ 2 ] = rand(); + x = []; // sparse array + x.length = 5; + x[ 2 ] = rand(); y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; expected = y.slice(); From 46674d7d91c4426ae2f1afd6d9c43449707ea1b2 Mon Sep 17 00:00:00 2001 From: MANDEep22332 Date: Thu, 19 Mar 2026 05:21:43 +0000 Subject: [PATCH 5/8] feat: add status object to anyByAsync to track in-flight operations --- .../@stdlib/utils/async/any-by/lib/factory.js | 150 ++++++------------ .../utils/async/any-by/test/test.factory.js | 88 ++++++++++ 2 files changed, 137 insertions(+), 101 deletions(-) diff --git a/lib/node_modules/@stdlib/utils/async/any-by/lib/factory.js b/lib/node_modules/@stdlib/utils/async/any-by/lib/factory.js index 192ba1923c98..77dd717dad9a 100644 --- a/lib/node_modules/@stdlib/utils/async/any-by/lib/factory.js +++ b/lib/node_modules/@stdlib/utils/async/any-by/lib/factory.js @@ -1,21 +1,3 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 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 // @@ -30,69 +12,6 @@ var limit = require( './limit.js' ); // MAIN // -/** -* Returns a function for testing whether at least one element in a collection passes a test implemented by a predicate function. -* -* ## Notes -* -* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling. -* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`). -* -* @param {Options} [options] - function options -* @param {*} [options.thisArg] - execution context -* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time -* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection -* @param {Function} predicate - predicate function to invoke for each element in a collection -* @throws {TypeError} options argument must be an object -* @throws {TypeError} must provide valid options -* @throws {TypeError} last argument must be a function -* @returns {Function} function which invokes the predicate function once for each element in a collection -* -* @example -* var readFile = require( '@stdlib/fs/read-file' ); -* -* function predicate( file, next ) { -* var opts = { -* 'encoding': 'utf8' -* }; -* readFile( file, opts, onFile ); -* -* function onFile( error ) { -* if ( error ) { -* return next( null, false ); -* } -* next( null, true ); -* } -* } -* -* var opts = { -* 'series': true -* }; -* -* // Create a `anyByAsync` function which invokes the predicate function for each collection element sequentially: -* var anyByAsync = factory( opts, predicate ); -* -* // Create a collection over which to iterate: -* var files = [ -* './beep.js', -* './boop.js' -* ]; -* -* // Define a callback which handles results: -* function done( error, bool ) { -* if ( error ) { -* throw error; -* } -* if ( bool ) { -* console.log( 'Successfully read at least one file.' ); -* } else { -* console.log( 'Unable to read any files.' ); -* } -* } -* -* // Try to read each element in `files`: -* anyByAsync( files, done ); -*/ function factory( options, predicate ) { var opts; var err; @@ -118,33 +37,62 @@ function factory( options, predicate ) { } return anyByAsync; - /** - * Invokes a predicate function for each element in a collection. - * - * @private - * @param {Collection} collection - input collection - * @param {Callback} done - function to invoke upon completion - * @throws {TypeError} first argument must be a collection - * @throws {TypeError} last argument must be a function - * @returns {void} - */ function anyByAsync( collection, done ) { + var status; + var i; + if ( !isCollection( collection ) ) { throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) ); } if ( !isFunction( done ) ) { throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) ); } - return limit( collection, opts, f, clbk ); - - /** - * Callback invoked upon completion. - * - * @private - * @param {*} [error] - error - * @param {boolean} bool - test result - * @returns {void} - */ + + // Create status object + status = { + 'nprocessed': 0, + 'ndone': 0, + 'nerrors': 0, + 'total': collection.length, + 'operations': [] + }; + for ( i = 0; i < collection.length; i++ ) { + status.operations.push({ + 'index': i, + 'status': 'pending' + }); + } + + limit( collection, opts, wrapper, clbk ); + + return status; + + function wrapper( value, index, col, next ) { + // Wrap next to intercept per-element completion + function onNext( error, bool ) { + if ( error ) { + status.nerrors += 1; + status.operations[ index ].status = 'fail'; + } else { + status.operations[ index ].status = 'ok'; + } + status.ndone += 1; + status.nprocessed += 1; + next( error, bool ); + } + + // Preserve original argument-count-based dispatch with thisArg context + if ( f.length === 1 || f.length === 0 ) { + f.call( opts.thisArg, value, index, col, onNext ); + } else if ( f.length === 2 ) { + f.call( opts.thisArg, value, onNext ); + } else if ( f.length === 3 ) { + f.call( opts.thisArg, value, index, onNext ); + } else { + f.call( opts.thisArg, value, index, col, onNext ); + } +} + function clbk( error, bool ) { if ( error ) { return done( error, false ); diff --git a/lib/node_modules/@stdlib/utils/async/any-by/test/test.factory.js b/lib/node_modules/@stdlib/utils/async/any-by/test/test.factory.js index d00d820e6836..bf6d360f8c1d 100644 --- a/lib/node_modules/@stdlib/utils/async/any-by/test/test.factory.js +++ b/lib/node_modules/@stdlib/utils/async/any-by/test/test.factory.js @@ -1011,3 +1011,91 @@ tape( 'the returned function does not guarantee asynchronous execution', functio t.end(); } }); + +tape( 'the returned function returns a status object', function test( t ) { + var anyByAsync; + var status; + var arr; + + function predicate( value, next ) { + setTimeout( function() { + next( null, false ); // never true, so all elements are processed + }, 0 ); + } + + function done( err, bool ) { + if ( err ) { + t.fail( err.message ); + return t.end(); + } + t.strictEqual( status.ndone, arr.length, 'ndone equals collection length' ); + t.strictEqual( status.nprocessed, arr.length, 'nprocessed equals collection length' ); + t.strictEqual( status.nerrors, 0, 'no errors' ); + t.strictEqual( bool, false, 'returns expected value' ); + t.end(); + } + + anyByAsync = factory( predicate ); + arr = [ 1, 2, 3 ]; + status = anyByAsync( arr, done ); + + // Status object should be returned immediately + t.strictEqual( typeof status, 'object', 'returns an object' ); + t.strictEqual( typeof status.nprocessed, 'number', 'has nprocessed property' ); + t.strictEqual( typeof status.ndone, 'number', 'has ndone property' ); + t.strictEqual( typeof status.nerrors, 'number', 'has nerrors property' ); + t.strictEqual( status.total, arr.length, 'has correct total' ); + t.strictEqual( Array.isArray( status.operations ), true, 'has operations array' ); +}); +tape( 'the status object tracks in-flight operations', function test( t ) { + var anyByAsync; + var status; + var arr; + + function predicate( value, next ) { + setTimeout( function() { + next( null, false ); + }, 0 ); + } + + function done( err, bool ) { + if ( err ) { + t.fail( err.message ); + return t.end(); + } + t.strictEqual( bool, false, 'returns expected value' ); + t.end(); + } + + anyByAsync = factory( predicate ); + arr = [ 1, 2, 3 ]; + status = anyByAsync( arr, done ); + + // Check initial pending status while ops are in-flight + t.strictEqual( status.operations[ 0 ].status, 'pending', 'first operation is pending' ); + t.strictEqual( status.operations[ 1 ].status, 'pending', 'second operation is pending' ); + t.strictEqual( status.operations[ 2 ].status, 'pending', 'third operation is pending' ); + t.strictEqual( status.ndone, 0, 'none done yet' ); +}); + +tape( 'the status object tracks errors', function test( t ) { + var anyByAsync; + var status; + var arr; + + function predicate( value, next ) { + setTimeout( function() { + next( new Error( 'beep' ) ); + }, 0 ); + } + + function done( err ) { + t.ok( err, 'returns an error' ); + t.strictEqual( status.nerrors, 1, 'nerrors is 1' ); + t.end(); + } + + anyByAsync = factory( { 'series': true }, predicate ); + arr = [ 1, 2, 3 ]; + status = anyByAsync( arr, done ); +}); From ceea62065c04d56bd85ff9cc96e690c97d926a27 Mon Sep 17 00:00:00 2001 From: MANDEep22332 Date: Thu, 19 Mar 2026 05:40:02 +0000 Subject: [PATCH 6/8] fix: ensure correct license header in factory.js --- .../@stdlib/utils/async/any-by/lib/factory.js | 157 +++++++++++++++--- 1 file changed, 133 insertions(+), 24 deletions(-) diff --git a/lib/node_modules/@stdlib/utils/async/any-by/lib/factory.js b/lib/node_modules/@stdlib/utils/async/any-by/lib/factory.js index 77dd717dad9a..703e1ffa24ca 100644 --- a/lib/node_modules/@stdlib/utils/async/any-by/lib/factory.js +++ b/lib/node_modules/@stdlib/utils/async/any-by/lib/factory.js @@ -1,3 +1,21 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2018 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 // @@ -12,6 +30,64 @@ var limit = require( './limit.js' ); // MAIN // +/** +* Returns a function for testing whether at least one element in a collection passes a test implemented by a predicate function. +* +* @param {Options} [options] - function options +* @param {*} [options.thisArg] - execution context +* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time +* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection +* @param {Function} predicate - predicate function to invoke for each element in a collection +* @throws {TypeError} options argument must be an object +* @throws {TypeError} must provide valid options +* @throws {TypeError} last argument must be a function +* @returns {Function} function which invokes the predicate function once for each element in a collection +* +* @example +* var readFile = require( '@stdlib/fs/read-file' ); +* +* function predicate( file, next ) { +* var opts = { +* 'encoding': 'utf8' +* }; +* readFile( file, opts, onFile ); +* +* function onFile( error ) { +* if ( error ) { +* return next( null, false ); +* } +* next( null, true ); +* } +* } +* +* var opts = { +* 'series': true +* }; +* +* // Create a `anyByAsync` function which invokes the predicate function for each collection element sequentially: +* var anyByAsync = factory( opts, predicate ); +* +* // Create a collection over which to iterate: +* var files = [ +* './beep.js', +* './boop.js' +* ]; +* +* // Define a callback which handles results: +* function done( error, bool ) { +* if ( error ) { +* throw error; +* } +* if ( bool ) { +* console.log( 'Successfully read at least one file.' ); +* } else { +* console.log( 'Unable to read any files.' ); +* } +* } +* +* // Try to read each element in `files`: +* anyByAsync( files, done ); +*/ function factory( options, predicate ) { var opts; var err; @@ -37,6 +113,16 @@ function factory( options, predicate ) { } return anyByAsync; + /** + * Invokes a predicate function for each element in a collection. + * + * @private + * @param {Collection} collection - input collection + * @param {Callback} done - function to invoke upon completion + * @throws {TypeError} first argument must be a collection + * @throws {TypeError} last argument must be a function + * @returns {Object} status object + */ function anyByAsync( collection, done ) { var status; var i; @@ -48,7 +134,7 @@ function factory( options, predicate ) { throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) ); } - // Create status object + // Create status object: status = { 'nprocessed': 0, 'ndone': 0, @@ -67,32 +153,55 @@ function factory( options, predicate ) { return status; + /** + * Wrapper function to intercept per-element completion and update status. + * + * @private + * @param {*} value - collection value + * @param {NonNegativeInteger} index - collection index + * @param {Collection} col - input collection + * @param {Callback} next - callback to invoke upon completion + * @returns {void} + */ function wrapper( value, index, col, next ) { - // Wrap next to intercept per-element completion - function onNext( error, bool ) { - if ( error ) { - status.nerrors += 1; - status.operations[ index ].status = 'fail'; - } else { - status.operations[ index ].status = 'ok'; + /** + * Callback invoked upon predicate completion. + * + * @private + * @param {*} error - error argument + * @param {boolean} bool - test result + * @returns {void} + */ + function onNext( error, bool ) { + if ( error ) { + status.nerrors += 1; + status.operations[ index ].status = 'fail'; + } else { + status.operations[ index ].status = 'ok'; + } + status.ndone += 1; + status.nprocessed += 1; + next( error, bool ); + } + if ( f.length === 1 || f.length === 0 ) { + f.call( opts.thisArg, value, index, col, onNext ); + } else if ( f.length === 2 ) { + f.call( opts.thisArg, value, onNext ); + } else if ( f.length === 3 ) { + f.call( opts.thisArg, value, index, onNext ); + } else { + f.call( opts.thisArg, value, index, col, onNext ); + } } - status.ndone += 1; - status.nprocessed += 1; - next( error, bool ); - } - - // Preserve original argument-count-based dispatch with thisArg context - if ( f.length === 1 || f.length === 0 ) { - f.call( opts.thisArg, value, index, col, onNext ); - } else if ( f.length === 2 ) { - f.call( opts.thisArg, value, onNext ); - } else if ( f.length === 3 ) { - f.call( opts.thisArg, value, index, onNext ); - } else { - f.call( opts.thisArg, value, index, col, onNext ); - } -} + /** + * Callback invoked upon completion. + * + * @private + * @param {*} [error] - error + * @param {boolean} bool - test result + * @returns {void} + */ function clbk( error, bool ) { if ( error ) { return done( error, false ); From 912ae5c2d0d4b144406e299297de2c216dc3ef84 Mon Sep 17 00:00:00 2001 From: MANDEep22332 Date: Thu, 19 Mar 2026 06:14:09 +0000 Subject: [PATCH 7/8] fix: clean up spellcheck words list and add ndone, nerrors, nprocessed, zalgo --- etc/eslint/rules/spellcheck.js | 11 ++++++-- .../utils/async/any-by/test/test.factory.js | 28 +++++++++++-------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/etc/eslint/rules/spellcheck.js b/etc/eslint/rules/spellcheck.js index 8c72144d65ec..3e84e7fa20ad 100644 --- a/etc/eslint/rules/spellcheck.js +++ b/etc/eslint/rules/spellcheck.js @@ -97,8 +97,14 @@ rules[ '@cspell/spellchecker' ] = [ 'warn', { 'ncols', 'ndims', 'ndim', - 'nout', + 'nprocessed', + 'nout', 'ndarray', + 'ndarrays', + 'ndim', + 'ndims', + 'ndone', + 'nerrors', 'ndarrays', 'nrows', 'nsubmodes', @@ -116,7 +122,8 @@ rules[ '@cspell/spellchecker' ] = [ 'warn', { 'trigamma', 'uncapitalize', 'unregularized', - 'Fréchet' + 'zalgo', + 'Fréchet' ] } }]; diff --git a/lib/node_modules/@stdlib/utils/async/any-by/test/test.factory.js b/lib/node_modules/@stdlib/utils/async/any-by/test/test.factory.js index bf6d360f8c1d..a5012a14751a 100644 --- a/lib/node_modules/@stdlib/utils/async/any-by/test/test.factory.js +++ b/lib/node_modules/@stdlib/utils/async/any-by/test/test.factory.js @@ -1011,16 +1011,17 @@ tape( 'the returned function does not guarantee asynchronous execution', functio t.end(); } }); - tape( 'the returned function returns a status object', function test( t ) { var anyByAsync; var status; var arr; function predicate( value, next ) { - setTimeout( function() { - next( null, false ); // never true, so all elements are processed - }, 0 ); + setTimeout( onTimeout, 0 ); + + function onTimeout() { + next( null, false ); + } } function done( err, bool ) { @@ -1039,7 +1040,6 @@ tape( 'the returned function returns a status object', function test( t ) { arr = [ 1, 2, 3 ]; status = anyByAsync( arr, done ); - // Status object should be returned immediately t.strictEqual( typeof status, 'object', 'returns an object' ); t.strictEqual( typeof status.nprocessed, 'number', 'has nprocessed property' ); t.strictEqual( typeof status.ndone, 'number', 'has ndone property' ); @@ -1047,15 +1047,18 @@ tape( 'the returned function returns a status object', function test( t ) { t.strictEqual( status.total, arr.length, 'has correct total' ); t.strictEqual( Array.isArray( status.operations ), true, 'has operations array' ); }); + tape( 'the status object tracks in-flight operations', function test( t ) { var anyByAsync; var status; var arr; function predicate( value, next ) { - setTimeout( function() { + setTimeout( onTimeout, 0 ); + + function onTimeout() { next( null, false ); - }, 0 ); + } } function done( err, bool ) { @@ -1071,7 +1074,6 @@ tape( 'the status object tracks in-flight operations', function test( t ) { arr = [ 1, 2, 3 ]; status = anyByAsync( arr, done ); - // Check initial pending status while ops are in-flight t.strictEqual( status.operations[ 0 ].status, 'pending', 'first operation is pending' ); t.strictEqual( status.operations[ 1 ].status, 'pending', 'second operation is pending' ); t.strictEqual( status.operations[ 2 ].status, 'pending', 'third operation is pending' ); @@ -1084,9 +1086,11 @@ tape( 'the status object tracks errors', function test( t ) { var arr; function predicate( value, next ) { - setTimeout( function() { + setTimeout( onTimeout, 0 ); + + function onTimeout() { next( new Error( 'beep' ) ); - }, 0 ); + } } function done( err ) { @@ -1095,7 +1099,9 @@ tape( 'the status object tracks errors', function test( t ) { t.end(); } - anyByAsync = factory( { 'series': true }, predicate ); + anyByAsync = factory({ + 'series': true + }, predicate ); arr = [ 1, 2, 3 ]; status = anyByAsync( arr, done ); }); From a47cd2ac787c735a091c3e84b4b27ba3e1f8046e Mon Sep 17 00:00:00 2001 From: MANDEep22332 Date: Thu, 19 Mar 2026 06:23:21 +0000 Subject: [PATCH 8/8] fix: fix closing bracket indentation in spellcheck words list --- etc/eslint/rules/spellcheck.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/etc/eslint/rules/spellcheck.js b/etc/eslint/rules/spellcheck.js index 3e84e7fa20ad..16734ef6d24c 100644 --- a/etc/eslint/rules/spellcheck.js +++ b/etc/eslint/rules/spellcheck.js @@ -80,9 +80,9 @@ rules[ '@cspell/spellchecker' ] = [ 'warn', { 'dilogarithm', 'dtype', 'dtypes', - 'exponentiated', 'evalpoly', 'evalrational', + 'exponentiated', 'hommel', 'iget', 'iset', @@ -95,17 +95,14 @@ rules[ '@cspell/spellchecker' ] = [ 'warn', { 'napi', 'nargs', 'ncols', - 'ndims', - 'ndim', - 'nprocessed', - 'nout', 'ndarray', - 'ndarrays', - 'ndim', - 'ndims', - 'ndone', - 'nerrors', 'ndarrays', + 'ndim', + 'ndims', + 'ndone', + 'nerrors', + 'nout', + 'nprocessed', 'nrows', 'nsubmodes', 'pvalues', @@ -123,7 +120,7 @@ rules[ '@cspell/spellchecker' ] = [ 'warn', { 'uncapitalize', 'unregularized', 'zalgo', - 'Fréchet' + 'Fréchet' ] } }];