fix: resolve strict typecheck fallout in setup, routing, and tests

This commit is contained in:
William Valentin
2026-02-15 23:22:05 -08:00
parent 948d4ac6d8
commit ae70818ec1
18 changed files with 182 additions and 134 deletions
+3 -2
View File
@@ -26,8 +26,9 @@ export const fileListTool: Tool = {
const args = rawArgs as FileListArgs;
try {
let entries = readdirSync(args.path, { withFileTypes: true });
if (args.pattern) {
entries = entries.filter(e => matchGlob(e.name, args.pattern));
const pattern = args.pattern;
if (typeof pattern === 'string' && pattern.length > 0) {
entries = entries.filter(e => matchGlob(e.name, pattern));
}
const output = entries
.map(e => e.isDirectory() ? `${e.name}/` : e.name)