From 438b369d5efdfdf8e7ea3b70540f5e7cf9929e93 Mon Sep 17 00:00:00 2001 From: Nick Van Doorn Date: Sat, 2 Mar 2019 02:49:39 -0800 Subject: Let\'s try again --- lib/path.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lib/path.ts (limited to 'lib/path.ts') diff --git a/lib/path.ts b/lib/path.ts new file mode 100644 index 0000000..ab2bb1c --- /dev/null +++ b/lib/path.ts @@ -0,0 +1,7 @@ +export const encodePath = (path: string): string => + path + .split('/') + .filter((k: string) => k) + .join('%2F') // encode the '/' char for the url + +export const decodePath = (path: string): string => `/${path}` -- cgit v1.2.3