From 2f48b69df1b56f88ffdd23be3d174310c0d7cfaf Mon Sep 17 00:00:00 2001 From: Utkarsh-Singhal-26 Date: Tue, 20 Jan 2026 10:13:45 +0530 Subject: [PATCH] chore: fix JavaScript lint errors (issue stdlib-js#9833) --- .../@stdlib/utils/async/reduce/lib/limit.js | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/lib/node_modules/@stdlib/utils/async/reduce/lib/limit.js b/lib/node_modules/@stdlib/utils/async/reduce/lib/limit.js index a98ce4cb5238..b0d865b80d04 100644 --- a/lib/node_modules/@stdlib/utils/async/reduce/lib/limit.js +++ b/lib/node_modules/@stdlib/utils/async/reduce/lib/limit.js @@ -76,6 +76,29 @@ function limit( collection, acc, opts, fcn, done ) { next(); // eslint-disable-line node/callback-return } } + + /** + * Callback invoked once a provided function finishes processing a collection element. + * + * @private + * @param {*} [error] - error + * @param {*} [result] - accumulation result + * @returns {void} + */ + function cb( error, result ) { + if ( flg ) { + // Prevent further processing of collection elements: + return; + } + if ( error ) { + flg = true; + return clbk( error ); + } + debug( 'Accumulator: %s', JSON.stringify( result ) ); + acc = result; + clbk(); + } + /** * Callback to invoke a provided function for the next element in a collection. * @@ -91,27 +114,6 @@ function limit( collection, acc, opts, fcn, done ) { } else { fcn.call( opts.thisArg, acc, collection[ idx ], idx, collection, cb ); // eslint-disable-line max-len } - /** - * Callback invoked once a provided function finishes processing a collection element. - * - * @private - * @param {*} [error] - error - * @param {*} [result] - accumulation result - * @returns {void} - */ - function cb( error, result ) { - if ( flg ) { - // Prevent further processing of collection elements: - return; - } - if ( error ) { - flg = true; - return clbk( error ); - } - debug( 'Accumulator: %s', JSON.stringify( result ) ); - acc = result; - clbk(); - } } /**