Skip to content

Commit 5852d17

Browse files
chore: fix JavaScript lint errors
PR-URL: stdlib-js#9837 Closes: stdlib-js#9833 Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
1 parent 2dfca5b commit 5852d17

File tree

1 file changed

+23
-21
lines changed
  • lib/node_modules/@stdlib/utils/async/reduce/lib

1 file changed

+23
-21
lines changed

lib/node_modules/@stdlib/utils/async/reduce/lib/limit.js

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,29 @@ function limit( collection, acc, opts, fcn, done ) {
7676
next(); // eslint-disable-line node/callback-return
7777
}
7878
}
79+
80+
/**
81+
* Callback invoked once a provided function finishes processing a collection element.
82+
*
83+
* @private
84+
* @param {*} [error] - error
85+
* @param {*} [result] - accumulation result
86+
* @returns {void}
87+
*/
88+
function cb( error, result ) {
89+
if ( flg ) {
90+
// Prevent further processing of collection elements:
91+
return;
92+
}
93+
if ( error ) {
94+
flg = true;
95+
return clbk( error );
96+
}
97+
debug( 'Accumulator: %s', JSON.stringify( result ) );
98+
acc = result;
99+
clbk();
100+
}
101+
79102
/**
80103
* Callback to invoke a provided function for the next element in a collection.
81104
*
@@ -91,27 +114,6 @@ function limit( collection, acc, opts, fcn, done ) {
91114
} else {
92115
fcn.call( opts.thisArg, acc, collection[ idx ], idx, collection, cb ); // eslint-disable-line max-len
93116
}
94-
/**
95-
* Callback invoked once a provided function finishes processing a collection element.
96-
*
97-
* @private
98-
* @param {*} [error] - error
99-
* @param {*} [result] - accumulation result
100-
* @returns {void}
101-
*/
102-
function cb( error, result ) {
103-
if ( flg ) {
104-
// Prevent further processing of collection elements:
105-
return;
106-
}
107-
if ( error ) {
108-
flg = true;
109-
return clbk( error );
110-
}
111-
debug( 'Accumulator: %s', JSON.stringify( result ) );
112-
acc = result;
113-
clbk();
114-
}
115117
}
116118

117119
/**

0 commit comments

Comments
 (0)