fix(canvas): case-insensitive extension lookup in getIcon + topology test fix #697
@ -28,7 +28,8 @@ const FILE_ICONS: Record<string, string> = {
|
||||
|
||||
export function getIcon(path: string, isDir: boolean): string {
|
||||
if (isDir) return "📁";
|
||||
const ext = "." + (path.split(".").pop() ?? "").toLowerCase();
|
||||
const parts = path.split(".");
|
||||
const ext = parts.length > 1 ? "." + parts[parts.length - 1].toLowerCase() : "";
|
||||
return FILE_ICONS[ext] || "📄";
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user