From 3f72a211ed3691588c3bde077756106b3186290e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 5 Oct 2026 00:39:54 +0000 Subject: [PATCH 1/3] docs: fix `@returns` annotation in `fs/read-file-list` The synchronous export returns an error object when a file read fails. Updated the JSDoc `@returns` type from `ObjectArray` to `(ObjectArray|Error)`, matching the TypeScript declaration, REPL text, and README. The `@returns` type of every other error-returning sync export in `@stdlib/fs` (11 of 12, 92%) already includes `Error`. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01KahG1EgmN7tCZG6qiYMmTG --- lib/node_modules/@stdlib/fs/read-file-list/lib/sync.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/fs/read-file-list/lib/sync.js b/lib/node_modules/@stdlib/fs/read-file-list/lib/sync.js index df4df3321694..0be736f6e79d 100644 --- a/lib/node_modules/@stdlib/fs/read-file-list/lib/sync.js +++ b/lib/node_modules/@stdlib/fs/read-file-list/lib/sync.js @@ -41,7 +41,7 @@ var debug = logger( 'read-file-list:sync' ); * @param {(string|null)} [options.encoding] - file encoding * @param {string} [options.flag] - file status flag * @throws {TypeError} must provide an array of strings -* @returns {ObjectArray} file contents +* @returns {(ObjectArray|Error)} file contents or an error * * @example * var list = [ __filename ]; From 97b50711c559694ac7d183d5c5f56385cc2c77e9 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 5 Oct 2026 00:42:52 +0000 Subject: [PATCH 2/3] refactor: use array literal in `fs/read-file-list` sync implementation Replaces `new Array( len )` with an array literal and `push`, resolving the `stdlib/no-new-array` lint error reported for this file. Files are read sequentially, so the output order is unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01KahG1EgmN7tCZG6qiYMmTG --- lib/node_modules/@stdlib/fs/read-file-list/lib/sync.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/fs/read-file-list/lib/sync.js b/lib/node_modules/@stdlib/fs/read-file-list/lib/sync.js index 0be736f6e79d..83b3987e0bbd 100644 --- a/lib/node_modules/@stdlib/fs/read-file-list/lib/sync.js +++ b/lib/node_modules/@stdlib/fs/read-file-list/lib/sync.js @@ -68,7 +68,7 @@ function readFileListSync( list, options ) { opts = {}; } len = list.length; - results = new Array( len ); + results = []; debug( 'Reading %d files...', len ); for ( i = 0; i < len; i++ ) { @@ -79,10 +79,10 @@ function readFileListSync( list, options ) { return file; } debug( 'Successfully read file: %s (%d of %d).', list[ i ], i, len ); - results[ i ] = { + results.push({ 'file': list[ i ], 'data': file - }; + }); } debug( 'Finished reading files.' ); return results; From c7bf408f4cb67f3b7730373f4337cfd279ca32e6 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 23:39:24 +0000 Subject: [PATCH 3/3] test: fix dependency stubbing in `_tools/search/pkg-index` tests The error-path tests proxyquired `lib/index.js`, but `@stdlib/_tools/pkgs/readmes` and `@stdlib/fs/read-file-list` are required by `lib/main.js`. The stubs therefore never applied, and the tests searched the real package directory and received `null` instead of an error. Proxyquire `lib/main.js` directly. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01KahG1EgmN7tCZG6qiYMmTG --- lib/node_modules/@stdlib/_tools/search/pkg-index/test/test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/_tools/search/pkg-index/test/test.js b/lib/node_modules/@stdlib/_tools/search/pkg-index/test/test.js index 6062a3c00e4b..f9dbb68d8b61 100644 --- a/lib/node_modules/@stdlib/_tools/search/pkg-index/test/test.js +++ b/lib/node_modules/@stdlib/_tools/search/pkg-index/test/test.js @@ -109,7 +109,7 @@ tape( 'the function returns an error to a provided callback if an error is encou var pkgIndex; var opts; - pkgIndex = proxyquire( './../lib/index.js', { + pkgIndex = proxyquire( './../lib/main.js', { '@stdlib/_tools/pkgs/readmes': find }); @@ -136,7 +136,7 @@ tape( 'the function returns an error to a provided callback if an error is encou var pkgIndex; var opts; - pkgIndex = proxyquire( './../lib/index.js', { + pkgIndex = proxyquire( './../lib/main.js', { '@stdlib/_tools/pkgs/readmes': find, '@stdlib/fs/read-file-list': readFileList });