fix: resolve strict typecheck fallout in setup, routing, and tests
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user