Browse Source

chore(app): cleanup

Adam 2 weeks ago
parent
commit
acc53d9f61
1 changed files with 1 additions and 5 deletions
  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()