-
Notifications
You must be signed in to change notification settings - Fork 0
v0.0.6 #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Warning Rate limit exceeded@wtasg has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 18 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
WalkthroughAdds a new factory Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller
participant Finder as createFindDirectories/deps
participant FS as FileSystem (readdir/stat)
Caller->>Finder: createFindDirectories({ readdir, stat })
Caller->>Finder: invoke find(root, options)
Finder->>FS: readdir(root, { withFileTypes: true })
FS-->>Finder: Dirent[] (name, isDirectory)
alt entry is directory & allowed
Finder->>Finder: include absPath
opt depth not exceeded
Finder->>FS: readdir(subdir, { withFileTypes: true })
FS-->>Finder: Dirent[] for subdir
Finder->>Finder: recurse into subdir
end
else blocked or not directory
Finder-->>Finder: skip entry
end
Finder-->>Caller: Promise.resolve(listOfAbsPaths)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 10
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (18)
DEV_CHECKLIST.md(0 hunks)docs/docs.json(0 hunks)docs/functions/createFindDirectories.md(1 hunks)docs/functions/hello.md(1 hunks)docs/functions/pojo.md(1 hunks)docs/globals.md(1 hunks)docs/interfaces/FileSystemDependencies.md(1 hunks)docs/interfaces/FindDirectoriesOptions.md(1 hunks)package.json(2 hunks)src/find.d.ts(1 hunks)src/find.js(1 hunks)src/find.test.d.ts(1 hunks)src/find.test.js(1 hunks)src/find.test.ts(1 hunks)src/find.ts(1 hunks)src/index.d.ts(1 hunks)src/index.js(1 hunks)src/index.ts(1 hunks)
💤 Files with no reviewable changes (2)
- DEV_CHECKLIST.md
- docs/docs.json
🧰 Additional context used
🧬 Code graph analysis (4)
src/find.js (1)
src/find.test.js (4)
deps(62-79)deps(92-114)findDirectories(27-27)findDirectories(54-54)
src/find.test.js (1)
src/find.js (1)
deps(7-7)
src/find.d.ts (2)
src/find.js (2)
deps(7-7)options(9-9)src/find.test.js (2)
deps(62-79)deps(92-114)
src/find.test.ts (3)
src/find.ts (2)
createFindDirectories(93-93)FileSystemDependencies(97-97)src/index.ts (2)
createFindDirectories(9-9)FileSystemDependencies(14-14)src/find.js (1)
deps(7-7)
🪛 markdownlint-cli2 (0.18.1)
docs/functions/createFindDirectories.md
1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
docs/interfaces/FindDirectoriesOptions.md
1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
docs/interfaces/FileSystemDependencies.md
1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
🔇 Additional comments (13)
docs/functions/hello.md (1)
11-11: LGTM!Documentation link updated to reflect the latest commit.
docs/functions/pojo.md (1)
11-11: LGTM!Documentation link updated to reflect the latest commit.
src/index.ts (2)
3-4: LGTM!Properly uses type-only imports for interfaces and regular import for the factory function.
6-15: Export structure looks good, but implementation file not provided.The export structure follows TypeScript best practices. However, the core implementation file
src/find.ts(orsrc/find.js) was not included in this review, so I cannot verify:
- The actual implementation of
createFindDirectories- The interface definitions for
FindDirectoriesOptionsandFileSystemDependencies- Whether the factory function and types work as intended
Please ensure that
src/find.tsand its compiled outputs are included in the PR and have been tested.src/index.js (1)
3-4: Export matches TypeScript source.The compiled JavaScript correctly exports
createFindDirectoriesalongside existing exports. Note that the implementation filesrc/find.jswas not provided for review.docs/globals.md (1)
7-16: LGTM!Documentation structure properly reflects the new API surface with interfaces and the factory function.
src/find.test.d.ts (1)
1-2: Empty export is standard for test declaration files.This serves as a module placeholder. Note that the actual test implementation (
src/find.test.tsorsrc/find.test.js) was not provided for review, so test coverage cannot be verified.docs/interfaces/FileSystemDependencies.md (1)
1-51: Documentation structure is clear and follows typedoc conventions.The interface documentation properly describes the dependency injection pattern for filesystem operations. The markdownlint warning about the first line is a false positive for auto-generated typedoc markdown.
Note that the actual implementation in
src/find.tswas not provided for review, so the interface definition and its usage cannot be verified.package.json (1)
31-31: typedoc@^0.28.15 is valid and current with no known security vulnerabilities.Version 0.28.15 is the latest release (published November 29, 2025) and has no publicly reported security issues in the Snyk vulnerability database or other sources.
docs/interfaces/FindDirectoriesOptions.md (1)
1-41: Auto-generated documentation looks correct.The interface properties align with the source definitions in
src/find.ts. The MD041 lint warning (first line should be a heading) is typical for auto-generated typedoc output and can be safely ignored if this is your standard doc format.docs/functions/createFindDirectories.md (1)
1-38: Documentation accurately reflects the API.Factory signature and return type are correctly documented. Links to related interfaces are properly set.
src/index.d.ts (1)
3-6: LGTM.Proper type-only and value imports with correct re-exports.
src/find.d.ts (1)
1-25: Declarations align with implementation.Same concerns apply:
statis required but unused,followSymlinksis declared but unimplemented. Update this file when addressing those issues insrc/find.ts.
| function createFindDirectories(deps) { | ||
| const { readdir } = deps; | ||
| return async function findDirectories(root, options = {}) { | ||
| const { maxDepth = 1, allowlist, blocklist } = options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stat is required but unused.
FileSystemDependencies requires stat, but only readdir is destructured and used. Either use stat or make it optional in the interface.
🤖 Prompt for AI Agents
In src/find.js around lines 6 to 9, the FileSystemDependencies interface
requires stat but the function only destructures and uses readdir; update the
function to also destructure stat from deps and use it when evaluating directory
entries (e.g., call stat on the entry path to confirm it is a directory before
including it) so the required dependency is actually used; alternatively, if
stat is optional in the design, change the interface/type to make stat optional
and handle the absence of stat by relying on readdir behavior, but do not leave
stat required and unused.
| import test from "node:test"; | ||
| import assert from "node:assert/strict"; | ||
| import { createFindDirectories } from "./find.js"; | ||
| // Helper to build Dirent-like objects | ||
| function dir(name) { | ||
| return { name, isDirectory: () => true }; | ||
| } | ||
| function file(name) { | ||
| return { name, isDirectory: () => false }; | ||
| } | ||
| test("find: findDirectories success", async () => { | ||
| // Minimal mock FS: /root contains one directory "a" and one file "b" | ||
| const mockFS = { | ||
| readdir: async (path) => { | ||
| if (path === "/root") { | ||
| return [ | ||
| { name: "a", isDirectory: () => true }, | ||
| { name: "b", isDirectory: () => false }, | ||
| ]; | ||
| } | ||
| return []; | ||
| }, | ||
| stat: async (path) => ({ | ||
| isDirectory: () => path === "/root" || path === "/root/a" | ||
| }), | ||
| }; | ||
| const findDirectories = createFindDirectories(mockFS); | ||
| const result = await findDirectories("/root", { maxDepth: 1 }); | ||
| assert.deepEqual(result, [ | ||
| "/root", | ||
| "/root/a" | ||
| ]); | ||
| }); | ||
| test("find: findDirectories symlink is NOT treated as a directory", async () => { | ||
| const mockFS = { | ||
| readdir: async (path) => { | ||
| if (path === "/root") { | ||
| return [ | ||
| { | ||
| name: "linkToA", | ||
| isDirectory: () => false | ||
| } | ||
| ]; | ||
| } | ||
| return []; | ||
| }, | ||
| stat: async (path) => ({ | ||
| isDirectory: () => path === "/root" // only root is a directory | ||
| }), | ||
| readlink: async () => { | ||
| throw new Error("readlink should not be called when symlink support is removed"); | ||
| } | ||
| }; | ||
| const findDirectories = createFindDirectories(mockFS); | ||
| const result = await findDirectories("/root", { maxDepth: 1 }); | ||
| assert.deepEqual(result, [ | ||
| "/root" | ||
| ]); | ||
| }); | ||
| test("find: findDirectories at depth=2", async () => { | ||
| const calls = []; | ||
| const deps = { | ||
| readdir: async (path) => { | ||
| calls.push(path); | ||
| switch (path) { | ||
| case "/root": | ||
| return [dir("a"), dir("b"), file("ignore.txt")]; | ||
| case "/root/a": | ||
| return [dir("a1")]; | ||
| case "/root/b": | ||
| return [dir("b1")]; | ||
| default: | ||
| return []; | ||
| } | ||
| }, | ||
| stat: async (_) => ({ | ||
| isDirectory: () => false | ||
| }) | ||
| }; | ||
| const find = createFindDirectories(deps); | ||
| const result = await find("/root", { maxDepth: 2 }); | ||
| assert.deepEqual(result.sort(), [ | ||
| "/root", | ||
| "/root/a", | ||
| "/root/b", | ||
| "/root/a/a1", | ||
| "/root/b/b1" | ||
| ].sort()); | ||
| }); | ||
| test("find: findDirectories at depth=3", async () => { | ||
| const calls = []; | ||
| const deps = { | ||
| readdir: async (path) => { | ||
| calls.push(path); | ||
| switch (path) { | ||
| case "/root": | ||
| return [dir("a"), dir("b")]; | ||
| case "/root/a": | ||
| return [dir("a1")]; | ||
| case "/root/b": | ||
| return [dir("b1")]; | ||
| case "/root/a/a1": | ||
| case "/root/b/b1": | ||
| return [dir("c")]; | ||
| case "/root/b/b1/c": | ||
| return [dir("d"), file("fd")]; | ||
| default: | ||
| return []; | ||
| } | ||
| }, | ||
| stat: async (_) => ({ | ||
| isDirectory: () => false | ||
| }) | ||
| }; | ||
| const find = createFindDirectories(deps); | ||
| const result = await find("/root", { maxDepth: 3 }); | ||
| assert.deepEqual(result.sort(), [ | ||
| "/root", | ||
| "/root/a", | ||
| "/root/b", | ||
| "/root/a/a1", | ||
| "/root/a/a1/c", | ||
| "/root/b/b1", | ||
| "/root/b/b1/c", | ||
| ].sort()); | ||
| }); | ||
| //# sourceMappingURL=find.test.js.map No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider adding tests for allowlist/blocklist.
The implementation supports allowlist and blocklist options, but no tests exercise this filtering logic.
Would you like me to generate test cases for the filtering functionality?
| interface FileSystemDependencies { | ||
| readdir: (path: string, opts: { withFileTypes: true }) => Promise<{ name: string; isDirectory(): boolean; }[]>; | ||
| stat: (path: string) => Promise<{ isDirectory(): boolean }>; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stat is required but never used.
The stat function is part of FileSystemDependencies but never called. Make it optional or remove it if not needed.
interface FileSystemDependencies {
readdir: (path: string, opts: { withFileTypes: true }) => Promise<{ name: string; isDirectory(): boolean; }[]>;
- stat: (path: string) => Promise<{ isDirectory(): boolean }>;
+ stat?: (path: string) => Promise<{ isDirectory(): boolean }>;
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| interface FileSystemDependencies { | |
| readdir: (path: string, opts: { withFileTypes: true }) => Promise<{ name: string; isDirectory(): boolean; }[]>; | |
| stat: (path: string) => Promise<{ isDirectory(): boolean }>; | |
| } | |
| interface FileSystemDependencies { | |
| readdir: (path: string, opts: { withFileTypes: true }) => Promise<{ name: string; isDirectory(): boolean; }[]>; | |
| stat?: (path: string) => Promise<{ isDirectory(): boolean }>; | |
| } |
🤖 Prompt for AI Agents
In src/find.ts around lines 3 to 6, the FileSystemDependencies interface
declares a stat method that is never used; either remove the stat property from
the interface or make it optional (stat?: ...) and update any
callers/implementations to not require providing stat; if other code expects
stat, prefer making it optional and add a runtime check before calling it,
otherwise remove it and adjust types where FileSystemDependencies is implemented
so implementations no longer need to supply stat.
| interface FindDirectoriesOptions { | ||
| maxDepth?: number; | ||
| followSymlinks?: boolean; | ||
| allowlist?: string[] | ((absPath: string, name: string) => boolean); | ||
| blocklist?: string[] | ((absPath: string, name: string) => boolean); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
followSymlinks option is declared but not implemented.
This option appears in the interface but the implementation ignores it. Either implement symlink following or remove the option to avoid misleading consumers.
🤖 Prompt for AI Agents
In src/find.ts around lines 8 to 13 the interface declares followSymlinks but
the implementation ignores it; either remove the option from the interface or
implement symlink handling. To implement: keep followSymlinks default false, use
fs.lstat to detect symlinks and fs.stat (or fs.realpath then stat) to read the
target when followSymlinks is true, resolve and continue traversal into the
target while applying maxDepth and allowlist/blocklist semantics to the resolved
target path; also maintain a Set of visited realpaths (or inode+device) to avoid
infinite loops from cyclic symlinks and ensure the API still returns the same
path form expected by callers. Add/update unit tests for symlinked directories
and cycles, and document the behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
docs/interfaces/FileSystemDependencies.md (1)
1-9: Fix markdown structure: heading should be first line (MD041).Same issue as FindDirectoriesOptions.md—adjust typedoc template to place
# Interface: FileSystemDependenciesas the first line before breadcrumb navigation.docs/functions/createFindDirectories.md (1)
1-11: Fix markdown structure: heading should be first line (MD041).Same typedoc template issue—place
# Function: createFindDirectories()as line 1 before breadcrumb navigation.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (8)
README.md(1 hunks)docs/README.md(1 hunks)docs/docs.json(8 hunks)docs/functions/createFindDirectories.md(1 hunks)docs/functions/hello.md(1 hunks)docs/functions/pojo.md(1 hunks)docs/interfaces/FileSystemDependencies.md(1 hunks)docs/interfaces/FindDirectoriesOptions.md(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/interfaces/FindDirectoriesOptions.md
1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
docs/functions/createFindDirectories.md
1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
docs/interfaces/FileSystemDependencies.md
1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
🔇 Additional comments (5)
docs/README.md (1)
16-16: Documentation addition is accurate and clear.README.md (1)
12-12: Documentation addition is consistent and accurate.docs/functions/pojo.md (1)
11-11: Source URL updated; no functional changes.docs/functions/hello.md (1)
11-11: Source URL updated; no functional changes.docs/docs.json (1)
1-1295: The docs.json metadata is accurate and fully verified against source implementation files.All function signatures, interface definitions, type parameters, and documentation comments in docs.json correctly match their corresponding source files (src/find.ts, src/hello.ts, src/pojo.ts, src/index.ts). Symbol IDs, type references, and parameter mappings are consistent and correct. No issues found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (4)
src/find.ts (1)
3-13: Remove or implement unusedstatandfollowSymlinksin the public API
FileSystemDependencies.statis never used, andFindDirectoriesOptions.followSymlinksis declared but ignored. This exposes dead/misleading surface in the public API: callers are asked to providestatand can setfollowSymlinkswithout any observable effect.Either:
- Implement symlink handling using
stat(and document behavior), or- Drop
statandfollowSymlinksfrom both the runtime types and the.d.tsdeclarations until you actually need them.Right now this is a behavioral mismatch for consumers.
src/find.test.js (1)
1-123: Add allowlist/blocklist coverage to JS tests as well.Tests exercise depth and symlink behavior but still don't cover
allowlist/blocklist; consider adding at least one positive/negative case to lock in that filtering contract, mirroring whatever you add to the TS tests.src/find.test.ts (1)
79-148: Add allowlist/blocklist tests to cover filtering semantics.Depth and symlink behavior are well covered, but nothing asserts
allowlist/blocklistbehavior (array and predicate forms); adding a couple of focused cases here would lock in that part of the API.src/find.js (1)
6-59: Align implementation withFileSystemDependencies/FindDirectoriesOptions(unusedstat, ignoredfollowSymlinks).The traversal logic itself looks solid, but the runtime only uses
readdirand ignores both thestatdependency and thefollowSymlinksoption that are exposed in the types/docs; that makes those API surface areas effectively no-ops today. Either:
- implement symlink/deeper directory detection using
stat/followSymlinks, or- trim or clearly mark those fields as reserved in the types/docs so consumers don’t expect behavior that isn’t there yet.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (25)
DEV_CHECKLIST.md(0 hunks)README.md(1 hunks)docs/README.md(1 hunks)docs/docs.json(9 hunks)docs/functions/createFindDirectories.md(1 hunks)docs/functions/hello.md(1 hunks)docs/functions/pojo.md(2 hunks)docs/globals.md(1 hunks)docs/interfaces/FileSystemDependencies.md(1 hunks)docs/interfaces/FindDirectoriesOptions.md(1 hunks)eslint.config.js(1 hunks)package.json(2 hunks)src/find.d.ts(1 hunks)src/find.js(1 hunks)src/find.test.d.ts(1 hunks)src/find.test.js(1 hunks)src/find.test.ts(1 hunks)src/find.ts(1 hunks)src/index.d.ts(1 hunks)src/index.js(1 hunks)src/index.ts(1 hunks)src/pojo.d.ts(1 hunks)src/pojo.js(1 hunks)src/pojo.ts(1 hunks)typedoc.json(1 hunks)
💤 Files with no reviewable changes (1)
- DEV_CHECKLIST.md
🧰 Additional context used
🧬 Code graph analysis (6)
src/find.test.ts (5)
src/find.d.ts (2)
createFindDirectories(23-23)FileSystemDependencies(24-24)src/find.ts (2)
createFindDirectories(93-93)FileSystemDependencies(97-97)src/index.d.ts (2)
createFindDirectories(5-5)FileSystemDependencies(6-6)src/index.ts (2)
createFindDirectories(9-9)FileSystemDependencies(14-14)src/find.js (1)
deps(7-7)
src/find.js (1)
src/find.test.js (4)
deps(61-77)deps(89-110)findDirectories(27-27)findDirectories(54-54)
src/find.test.js (5)
src/find.d.ts (1)
createFindDirectories(23-23)src/find.ts (1)
createFindDirectories(93-93)src/index.d.ts (1)
createFindDirectories(5-5)src/index.ts (1)
createFindDirectories(9-9)src/find.js (1)
deps(7-7)
src/find.d.ts (4)
src/find.ts (3)
FileSystemDependencies(97-97)FindDirectoriesOptions(98-98)createFindDirectories(93-93)src/index.d.ts (3)
FileSystemDependencies(6-6)FindDirectoriesOptions(6-6)createFindDirectories(5-5)src/find.js (2)
deps(7-7)options(9-9)src/find.test.js (2)
deps(61-77)deps(89-110)
src/pojo.ts (3)
src/index.d.ts (1)
pojo(5-5)src/index.ts (1)
pojo(8-8)src/pojo.d.ts (1)
pojo(11-11)
src/find.ts (2)
src/find.js (1)
deps(7-7)src/find.test.js (4)
deps(61-77)deps(89-110)findDirectories(27-27)findDirectories(54-54)
🔇 Additional comments (18)
docs/functions/hello.md (1)
11-11: Doc link update is fineThe updated
Defined inlink just tracks the new commit; no issues.eslint.config.js (1)
1-36: Flat ESLint config wiring looks coherentCombining
eslint+typescript-eslintpresets witheslint-config-prettier, node globals, and the_unused‑var convention is consistent and should work well with the added tooling.src/find.d.ts (1)
1-24: Type declarations align with implementation
FileSystemDependencies,FindDirectoriesOptions, andcreateFindDirectoriesmatch the shapes used insrc/find.ts; public surface looks consistent.src/find.ts (1)
19-89: Traversal, depth limiting, and filters look correctThe core walker logic—root normalization,
maxDepthhandling, root inclusion, and theallowlist/blocklistshort‑circuiting on directory entries—looks sound and matches the documented “find -type d” style behavior.docs/README.md (1)
14-17: Docs entry forcreateFindDirectoriesis clearThe new Functions bullet accurately describes
createFindDirectoriesand matches the implemented behavior.typedoc.json (1)
3-12: Typedoc config reformat is no-op behaviorallySwitching
entryPointsandpluginto multi-line arrays doesn’t change semantics; configuration remains valid.README.md (1)
10-13: README now reflects the new factory APIAdding
createFindDirectoriesto the Functions list keeps the package README aligned with the newly exposed API.src/pojo.js (1)
8-8: LGTM! Type annotation improved.The return type change from
anytounknownaligns with TypeScript best practices and improves type safety.docs/interfaces/FileSystemDependencies.md (1)
1-51: LGTM! Interface documentation is accurate.The FileSystemDependencies interface is properly documented with clear method signatures for readdir and stat.
docs/globals.md (1)
7-16: LGTM! Documentation structure updated correctly.The new Interfaces section and createFindDirectories function entry properly reflect the expanded API surface.
docs/functions/pojo.md (1)
9-33: LGTM! Documentation reflects the improved type annotation.The pojo function documentation correctly shows the updated return type
Record<string, unknown>.src/find.test.d.ts (1)
1-2: LGTM! Standard test declaration file.The empty export statement correctly establishes this as a module.
docs/functions/createFindDirectories.md (1)
1-38: LGTM! Factory function documentation is comprehensive.The createFindDirectories documentation clearly explains the dependency injection pattern and provides complete type information.
src/index.js (1)
3-4: ✓ Verified: find.js exists and properly exports createFindDirectories.The file is present at
src/find.js, exportscreateFindDirectorieson line 61, and the import/export chain insrc/index.jsis correctly configured. The public API expansion is valid.src/pojo.d.ts (1)
8-10: Stricterpojoreturn type looks good; be aware of downstream TS impact.Switching from
Record<string, any>toRecord<string, unknown>is a nice safety win and matches the JSDoc; just note this may surface new compile-time errors for consumers that assumedany.src/pojo.ts (1)
8-18:pojoimplementation and updated typing are consistent.Function body, JSDoc, and declaration now all agree on
Record<string, unknown>with unchanged runtime behavior.src/index.ts (1)
3-15: Index wiring forcreateFindDirectoriesand types looks correct.Re-exports are coherent, and using
import typefor the option/dependency types avoids runtime overhead.src/index.d.ts (1)
3-6: Declaration surface matches the new runtime exports.
createFindDirectoriesand its option/dependency types are correctly re-exported alongsidehelloandpojo.
| { | ||
| "id": 27, | ||
| "name": "FileSystemDependencies", | ||
| "variant": "declaration", | ||
| "kind": 256, | ||
| "flags": {}, | ||
| "children": [ | ||
| { | ||
| "id": 28, | ||
| "name": "readdir", | ||
| "variant": "declaration", | ||
| "kind": 1024, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 4, | ||
| "character": 4, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L4" | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "reflection", | ||
| "declaration": { | ||
| "id": 29, | ||
| "name": "__type", | ||
| "variant": "declaration", | ||
| "kind": 65536, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 4, | ||
| "character": 13, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L4" | ||
| } | ||
| ], | ||
| "signatures": [ | ||
| { | ||
| "id": 30, | ||
| "name": "__type", | ||
| "variant": "signature", | ||
| "kind": 4096, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 4, | ||
| "character": 13, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L4" | ||
| } | ||
| ], | ||
| "parameters": [ | ||
| { | ||
| "id": 31, | ||
| "name": "path", | ||
| "variant": "param", | ||
| "kind": 32768, | ||
| "flags": {}, | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "string" | ||
| } | ||
| }, | ||
| { | ||
| "id": 32, | ||
| "name": "opts", | ||
| "variant": "param", | ||
| "kind": 32768, | ||
| "flags": {}, | ||
| "type": { | ||
| "type": "reflection", | ||
| "declaration": { | ||
| "id": 33, | ||
| "name": "__type", | ||
| "variant": "declaration", | ||
| "kind": 65536, | ||
| "flags": {}, | ||
| "children": [ | ||
| { | ||
| "id": 34, | ||
| "name": "withFileTypes", | ||
| "variant": "declaration", | ||
| "kind": 1024, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 4, | ||
| "character": 36, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L4" | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "literal", | ||
| "value": true | ||
| } | ||
| } | ||
| ], | ||
| "groups": [ | ||
| { | ||
| "title": "Properties", | ||
| "children": [ | ||
| 34 | ||
| ] | ||
| } | ||
| ], | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 4, | ||
| "character": 34, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L4" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "reference", | ||
| "target": { | ||
| "packageName": "typescript", | ||
| "packagePath": "lib/lib.es5.d.ts", | ||
| "qualifiedName": "Promise" | ||
| }, | ||
| "typeArguments": [ | ||
| { | ||
| "type": "array", | ||
| "elementType": { | ||
| "type": "reflection", | ||
| "declaration": { | ||
| "id": 35, | ||
| "name": "__type", | ||
| "variant": "declaration", | ||
| "kind": 65536, | ||
| "flags": {}, | ||
| "children": [ | ||
| { | ||
| "id": 36, | ||
| "name": "name", | ||
| "variant": "declaration", | ||
| "kind": 1024, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 4, | ||
| "character": 72, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L4" | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "string" | ||
| } | ||
| }, | ||
| { | ||
| "id": 37, | ||
| "name": "isDirectory", | ||
| "variant": "declaration", | ||
| "kind": 2048, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 4, | ||
| "character": 86, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L4" | ||
| } | ||
| ], | ||
| "signatures": [ | ||
| { | ||
| "id": 38, | ||
| "name": "isDirectory", | ||
| "variant": "signature", | ||
| "kind": 4096, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 4, | ||
| "character": 86, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L4" | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "boolean" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "groups": [ | ||
| { | ||
| "title": "Properties", | ||
| "children": [ | ||
| 36 | ||
| ] | ||
| }, | ||
| { | ||
| "title": "Methods", | ||
| "children": [ | ||
| 37 | ||
| ] | ||
| } | ||
| ], | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 4, | ||
| "character": 70, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L4" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "name": "Promise", | ||
| "package": "typescript" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "id": 39, | ||
| "name": "stat", | ||
| "variant": "declaration", | ||
| "kind": 1024, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 5, | ||
| "character": 4, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L5" | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "reflection", | ||
| "declaration": { | ||
| "id": 40, | ||
| "name": "__type", | ||
| "variant": "declaration", | ||
| "kind": 65536, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 5, | ||
| "character": 10, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L5" | ||
| } | ||
| ], | ||
| "signatures": [ | ||
| { | ||
| "id": 41, | ||
| "name": "__type", | ||
| "variant": "signature", | ||
| "kind": 4096, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 5, | ||
| "character": 10, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L5" | ||
| } | ||
| ], | ||
| "parameters": [ | ||
| { | ||
| "id": 42, | ||
| "name": "path", | ||
| "variant": "param", | ||
| "kind": 32768, | ||
| "flags": {}, | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "string" | ||
| } | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "reference", | ||
| "target": { | ||
| "packageName": "typescript", | ||
| "packagePath": "lib/lib.es5.d.ts", | ||
| "qualifiedName": "Promise" | ||
| }, | ||
| "typeArguments": [ | ||
| { | ||
| "type": "reflection", | ||
| "declaration": { | ||
| "id": 43, | ||
| "name": "__type", | ||
| "variant": "declaration", | ||
| "kind": 65536, | ||
| "flags": {}, | ||
| "children": [ | ||
| { | ||
| "id": 44, | ||
| "name": "isDirectory", | ||
| "variant": "declaration", | ||
| "kind": 2048, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 5, | ||
| "character": 38, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L5" | ||
| } | ||
| ], | ||
| "signatures": [ | ||
| { | ||
| "id": 45, | ||
| "name": "isDirectory", | ||
| "variant": "signature", | ||
| "kind": 4096, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 5, | ||
| "character": 38, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L5" | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "boolean" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "groups": [ | ||
| { | ||
| "title": "Methods", | ||
| "children": [ | ||
| 44 | ||
| ] | ||
| } | ||
| ], | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 5, | ||
| "character": 36, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L5" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ], | ||
| "name": "Promise", | ||
| "package": "typescript" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "groups": [ | ||
| { | ||
| "title": "Properties", | ||
| "children": [ | ||
| 28, | ||
| 39 | ||
| ] | ||
| } | ||
| ], | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 3, | ||
| "character": 10, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L3" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "id": 14, | ||
| "name": "FindDirectoriesOptions", | ||
| "variant": "declaration", | ||
| "kind": 256, | ||
| "flags": {}, | ||
| "children": [ | ||
| { | ||
| "id": 17, | ||
| "name": "allowlist", | ||
| "variant": "declaration", | ||
| "kind": 1024, | ||
| "flags": { | ||
| "isOptional": true | ||
| }, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 11, | ||
| "character": 4, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L11" | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "union", | ||
| "types": [ | ||
| { | ||
| "type": "array", | ||
| "elementType": { | ||
| "type": "intrinsic", | ||
| "name": "string" | ||
| } | ||
| }, | ||
| { | ||
| "type": "reflection", | ||
| "declaration": { | ||
| "id": 18, | ||
| "name": "__type", | ||
| "variant": "declaration", | ||
| "kind": 65536, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 11, | ||
| "character": 28, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L11" | ||
| } | ||
| ], | ||
| "signatures": [ | ||
| { | ||
| "id": 19, | ||
| "name": "__type", | ||
| "variant": "signature", | ||
| "kind": 4096, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 11, | ||
| "character": 28, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L11" | ||
| } | ||
| ], | ||
| "parameters": [ | ||
| { | ||
| "id": 20, | ||
| "name": "absPath", | ||
| "variant": "param", | ||
| "kind": 32768, | ||
| "flags": {}, | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "string" | ||
| } | ||
| }, | ||
| { | ||
| "id": 21, | ||
| "name": "name", | ||
| "variant": "param", | ||
| "kind": 32768, | ||
| "flags": {}, | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "string" | ||
| } | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "boolean" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "id": 22, | ||
| "name": "blocklist", | ||
| "variant": "declaration", | ||
| "kind": 1024, | ||
| "flags": { | ||
| "isOptional": true | ||
| }, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 12, | ||
| "character": 4, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L12" | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "union", | ||
| "types": [ | ||
| { | ||
| "type": "array", | ||
| "elementType": { | ||
| "type": "intrinsic", | ||
| "name": "string" | ||
| } | ||
| }, | ||
| { | ||
| "type": "reflection", | ||
| "declaration": { | ||
| "id": 23, | ||
| "name": "__type", | ||
| "variant": "declaration", | ||
| "kind": 65536, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 12, | ||
| "character": 28, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L12" | ||
| } | ||
| ], | ||
| "signatures": [ | ||
| { | ||
| "id": 24, | ||
| "name": "__type", | ||
| "variant": "signature", | ||
| "kind": 4096, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 12, | ||
| "character": 28, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L12" | ||
| } | ||
| ], | ||
| "parameters": [ | ||
| { | ||
| "id": 25, | ||
| "name": "absPath", | ||
| "variant": "param", | ||
| "kind": 32768, | ||
| "flags": {}, | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "string" | ||
| } | ||
| }, | ||
| { | ||
| "id": 26, | ||
| "name": "name", | ||
| "variant": "param", | ||
| "kind": 32768, | ||
| "flags": {}, | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "string" | ||
| } | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "boolean" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "id": 16, | ||
| "name": "followSymlinks", | ||
| "variant": "declaration", | ||
| "kind": 1024, | ||
| "flags": { | ||
| "isOptional": true | ||
| }, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 10, | ||
| "character": 4, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L10" | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "boolean" | ||
| } | ||
| }, | ||
| { | ||
| "id": 15, | ||
| "name": "maxDepth", | ||
| "variant": "declaration", | ||
| "kind": 1024, | ||
| "flags": { | ||
| "isOptional": true | ||
| }, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 9, | ||
| "character": 4, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L9" | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "number" | ||
| } | ||
| } | ||
| ], | ||
| "groups": [ | ||
| { | ||
| "title": "Properties", | ||
| "children": [ | ||
| 17, | ||
| 22, | ||
| 16, | ||
| 15 | ||
| ] | ||
| } | ||
| ], | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 8, | ||
| "character": 10, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L8" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "id": 7, | ||
| "name": "createFindDirectories", | ||
| "variant": "declaration", | ||
| "kind": 64, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 19, | ||
| "character": 9, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L19" | ||
| } | ||
| ], | ||
| "signatures": [ | ||
| { | ||
| "id": 8, | ||
| "name": "createFindDirectories", | ||
| "variant": "signature", | ||
| "kind": 4096, | ||
| "flags": {}, | ||
| "comment": { | ||
| "summary": [ | ||
| { | ||
| "kind": "text", | ||
| "text": "Factory that produces an async findDirectories function with\ninjected filesystem dependencies for full testability." | ||
| } | ||
| ] | ||
| }, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 19, | ||
| "character": 9, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L19" | ||
| } | ||
| ], | ||
| "parameters": [ | ||
| { | ||
| "id": 9, | ||
| "name": "deps", | ||
| "variant": "param", | ||
| "kind": 32768, | ||
| "flags": {}, | ||
| "type": { | ||
| "type": "reference", | ||
| "target": 27, | ||
| "name": "FileSystemDependencies", | ||
| "package": "@wtasnorg/node-lib" | ||
| } | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "reflection", | ||
| "declaration": { | ||
| "id": 10, | ||
| "name": "__type", | ||
| "variant": "declaration", | ||
| "kind": 65536, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 23, | ||
| "character": 26, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L23" | ||
| } | ||
| ], | ||
| "signatures": [ | ||
| { | ||
| "id": 11, | ||
| "name": "__type", | ||
| "variant": "signature", | ||
| "kind": 4096, | ||
| "flags": {}, | ||
| "sources": [ | ||
| { | ||
| "fileName": "find.ts", | ||
| "line": 23, | ||
| "character": 26, | ||
| "url": "https://github.com/wtasg/node-lib/blob/5ef6c801dee6a05d879c445d672ee6c2f8da4ba4/src/find.ts#L23" | ||
| } | ||
| ], | ||
| "parameters": [ | ||
| { | ||
| "id": 12, | ||
| "name": "root", | ||
| "variant": "param", | ||
| "kind": 32768, | ||
| "flags": {}, | ||
| "type": { | ||
| "type": "intrinsic", | ||
| "name": "string" | ||
| } | ||
| }, | ||
| { | ||
| "id": 13, | ||
| "name": "options", | ||
| "variant": "param", | ||
| "kind": 32768, | ||
| "flags": {}, | ||
| "type": { | ||
| "type": "reference", | ||
| "target": 14, | ||
| "name": "FindDirectoriesOptions", | ||
| "package": "@wtasnorg/node-lib" | ||
| }, | ||
| "defaultValue": "{}" | ||
| } | ||
| ], | ||
| "type": { | ||
| "type": "reference", | ||
| "target": { | ||
| "packageName": "typescript", | ||
| "packagePath": "lib/lib.es5.d.ts", | ||
| "qualifiedName": "Promise" | ||
| }, | ||
| "typeArguments": [ | ||
| { | ||
| "type": "array", | ||
| "elementType": { | ||
| "type": "intrinsic", | ||
| "name": "string" | ||
| } | ||
| } | ||
| ], | ||
| "name": "Promise", | ||
| "package": "typescript" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs describe options/deps that are currently no-ops in implementation.
FileSystemDependencies.stat and FindDirectoriesOptions.followSymlinks are documented here but are not used by createFindDirectories in src/find.js; consumers may reasonably expect them to affect behavior. Consider either:
- updating the implementation to honor these fields, or
- trimming/annotating them in docs as reserved so the generated docs match what the code actually does today.
🤖 Prompt for AI Agents
In docs/docs.json around lines 9 to 784 the docs advertise
FileSystemDependencies.stat and FindDirectoriesOptions.followSymlinks but the
runtime in src/find.js/createFindDirectories ignores those fields; either (A)
implement support in src/find.js: wire deps.stat into directory checks (use it
instead of fs.stat when provided), add logic to detect/resolve symlinks and
honor options.followSymlinks (skip or recurse symlinked dirs when false, follow
when true), update types/tests and docs accordingly; or (B) make the docs
truthful: remove those properties from docs/docs.json or annotate them as
reserved/unused so generated docs match current behavior. Apply one of these
fixes and update tests and changelog to reflect the chosen approach.
find.ts: createFindDirectories()
Adds
createFindDirectories, a testable factory function for recursive directory discovery with dependency injection.Core Changes:
createFindDirectories(deps)factory accepting injected filesystem dependencies (readdir, stat)(root, options?) => Promise<string[]>discovering directories recursivelymaxDepth(default 1),allowlist/blocklistfilters (array or predicate-based)helloandpojofunctionsTypes:
FileSystemDependencies: readdir and stat method signatures for FS abstractionFindDirectoriesOptions: maxDepth, followSymlinks, allowlist, blocklist configurationTesting:
Supporting Changes: