From 985763e3fcb6762fa76b81c059a97648905b3761 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 18 Jul 2020 21:54:58 +0200 Subject: Started fileview --- src/util/files.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/util/files.ts (limited to 'src/util/files.ts') 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"); +}; -- cgit v1.2.3