summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop/src/utils/path.ts
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-11-25 16:02:27 -0600
committerAdam <[email protected]>2025-11-25 16:02:31 -0600
commit447713244820e875e192a5815c4d8bc76c03b40f (patch)
treea3df06b1df0585a8387c37826ea516ce08169289 /packages/desktop/src/utils/path.ts
parenteaeea45ace01e20405d49d1a659030a4d131dc83 (diff)
downloadopencode-447713244820e875e192a5815c4d8bc76c03b40f.tar.gz
opencode-447713244820e875e192a5815c4d8bc76c03b40f.zip
fix: sanitize absolute paths
Diffstat (limited to 'packages/desktop/src/utils/path.ts')
-rw-r--r--packages/desktop/src/utils/path.ts20
1 files changed, 0 insertions, 20 deletions
diff --git a/packages/desktop/src/utils/path.ts b/packages/desktop/src/utils/path.ts
deleted file mode 100644
index d23568ae6..000000000
--- a/packages/desktop/src/utils/path.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { useSync } from "@/context/sync"
-
-export function getFilename(path: string) {
- if (!path) return ""
- const trimmed = path.replace(/[\/]+$/, "")
- const parts = trimmed.split("/")
- return parts[parts.length - 1] ?? ""
-}
-
-export function getDirectory(path: string) {
- const sync = useSync()
- const parts = path.split("/")
- const dir = parts.slice(0, parts.length - 1).join("/")
- return dir ? sync.sanitize(dir + "/") : ""
-}
-
-export function getFileExtension(path: string) {
- const parts = path.split(".")
- return parts[parts.length - 1]
-}