From 41f4ebf3c958a83a1f1b8463c7aa1d0c27dc8167 Mon Sep 17 00:00:00 2001 From: sagar7162 Date: Tue, 21 Oct 2025 13:14:57 +0000 Subject: [PATCH] chore: fix JavaScript lint errors (issue #8258) --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../_tools/github/star-repo/lib/query.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/_tools/github/star-repo/lib/query.js b/lib/node_modules/@stdlib/_tools/github/star-repo/lib/query.js index 040d3d189c2c..352fd5168bc0 100644 --- a/lib/node_modules/@stdlib/_tools/github/star-repo/lib/query.js +++ b/lib/node_modules/@stdlib/_tools/github/star-repo/lib/query.js @@ -62,6 +62,8 @@ function query( slug, options, clbk ) { * @returns {void} */ function done( error, response ) { + var resetDate; + var resetISO; var info; if ( arguments.length === 1 ) { debug( 'No available rate limit information.' ); @@ -73,7 +75,20 @@ function query( slug, options, clbk ) { info = ratelimit( response.headers ); debug( 'Rate limit: %d', info.limit ); debug( 'Rate limit remaining: %d', info.remaining ); - debug( 'Rate limit reset: %s', (new Date( info.reset*1000 )).toISOString() ); + + // Guard against invalid or missing reset values which would throw a RangeError when calling toISOString: + resetISO = 'n/a'; + if ( + info && + typeof info.reset === 'number' && + isFinite( info.reset ) + ) { + resetDate = new Date( info.reset*1000 ); + if ( !isNaN( resetDate.getTime() ) ) { + resetISO = resetDate.toISOString(); + } + } + debug( 'Rate limit reset: %s', resetISO ); if ( error ) { return clbk( error, info );