Chore: satisfy lint after tool-meta refactor

This commit is contained in:
Peter Steinberger
2025-12-03 10:42:10 +00:00
parent 597e7e6f13
commit e34d0d69aa
3 changed files with 30 additions and 25 deletions

View File

@@ -2,7 +2,8 @@ export const TOOL_RESULT_DEBOUNCE_MS = 1000;
function shortenPath(p: string): string {
const home = process.env.HOME;
if (home && (p === home || p.startsWith(`${home}/`))) return p.replace(home, "~");
if (home && (p === home || p.startsWith(`${home}/`)))
return p.replace(home, "~");
return p;
}
@@ -31,9 +32,11 @@ export function formatToolAggregate(
if (parts.length > 1) {
const dir = parts.slice(0, -1).join("/");
const base = parts.at(-1) ?? m;
(grouped[dir] ||= []).push(base);
if (!grouped[dir]) grouped[dir] = [];
grouped[dir].push(base);
} else {
(grouped["."] ||= []).push(m);
if (!grouped["."]) grouped["."] = [];
grouped["."].push(m);
}
}