From 4b46a3af98eaf88e453c0683823b55b0feb0d5a8 Mon Sep 17 00:00:00 2001 From: VEER RAJ <136178369+VeerRaj-007@users.noreply.github.com> Date: Fri, 28 Mar 2025 21:53:13 +0530 Subject: [PATCH 1/2] Update main.js Issue: Using new Array() violates the stdlib/no-new-array rule. Signed-off-by: VEER RAJ <136178369+VeerRaj-007@users.noreply.github.com> --- lib/node_modules/@stdlib/utils/async/if-then/lib/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/utils/async/if-then/lib/main.js b/lib/node_modules/@stdlib/utils/async/if-then/lib/main.js index cf22495734aa..b61f7c9355d9 100644 --- a/lib/node_modules/@stdlib/utils/async/if-then/lib/main.js +++ b/lib/node_modules/@stdlib/utils/async/if-then/lib/main.js @@ -119,7 +119,8 @@ function ifthenAsync( predicate, x, y, done ) { return done( error ); } nargs = arguments.length; - args = new Array( nargs ); + const args = []; + args.length = nargs; args[ 0 ] = null; for ( i = 1; i < nargs; i++ ) { args[ i ] = arguments[ i ]; From 29fd9eb27058f3c6fc3c91485a8a9657a5c13f8d Mon Sep 17 00:00:00 2001 From: VEER RAJ <136178369+VeerRaj-007@users.noreply.github.com> Date: Fri, 28 Mar 2025 22:07:56 +0530 Subject: [PATCH 2/2] Update main.js Signed-off-by: VEER RAJ <136178369+VeerRaj-007@users.noreply.github.com> --- lib/node_modules/@stdlib/utils/async/if-then/lib/main.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/utils/async/if-then/lib/main.js b/lib/node_modules/@stdlib/utils/async/if-then/lib/main.js index b61f7c9355d9..1cef98176cb6 100644 --- a/lib/node_modules/@stdlib/utils/async/if-then/lib/main.js +++ b/lib/node_modules/@stdlib/utils/async/if-then/lib/main.js @@ -113,17 +113,14 @@ function ifthenAsync( predicate, x, y, done ) { */ function clbk2( error ) { var nargs; - var args; var i; if ( error ) { return done( error ); } nargs = arguments.length; - const args = []; - args.length = nargs; - args[ 0 ] = null; + const args = [null]; for ( i = 1; i < nargs; i++ ) { - args[ i ] = arguments[ i ]; + args.push(arguments[ i ]); } done.apply( null, args ); }