aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMarvin Borner2020-07-18 21:54:58 +0200
committerMarvin Borner2020-07-18 21:54:58 +0200
commit985763e3fcb6762fa76b81c059a97648905b3761 (patch)
treee74ddab34567adcb659fcf27b2dc8b227c0c2637 /src/util
parentc96473af48f650ac568a9a9203f3d6bbe74ff080 (diff)
Started fileview
Diffstat (limited to 'src/util')
-rw-r--r--src/util/files.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util/files.ts b/src/util/files.ts
new file mode 100644
index 0000000..ec1f584
--- /dev/null
+++ b/src/util/files.ts
@@ -0,0 +1,7 @@
+export const cleanPath = (path: string) => {
+ return path
+ .replace("/files/", "")
+ .replace("../", "") // TODO: Fix relative ../
+ .replace("./", "")
+ .replace(/([^:]\/)\/+/g, "$1");
+};