Przeglądaj źródła

chore(app): cleanup

Adam 8 miesięcy temu
rodzic
commit
acc53d9f61
1 zmienionych plików z 1 dodań i 5 usunięć
  1. 1 5
      packages/ui/src/components/file-icon.tsx

+ 1 - 5
packages/ui/src/components/file-icon.tsx

@@ -538,11 +538,7 @@ const toOpenVariant = (icon: IconName): IconName => {
   return icon
 }
 
-const basenameOf = (p: string) =>
-  p
-    .replace(/[/\\]+$/, "")
-    .split(/[\\/]/)
-    .pop() ?? ""
+const basenameOf = (p: string) => p.split("\\").join("/").split("/").filter(Boolean).pop() ?? ""
 
 const folderNameVariants = (name: string) => {
   const n = name.toLowerCase()