diff options
author | Nick Van Doorn <vandoorn.nick@gmail.com> | 2019-03-02 02:49:39 -0800 |
---|---|---|
committer | Nick Van Doorn <vandoorn.nick@gmail.com> | 2019-03-02 02:49:39 -0800 |
commit | 438b369d5efdfdf8e7ea3b70540f5e7cf9929e93 (patch) | |
tree | 7a4e86146c79d64e8c8e35db37ea2824eafae07b /lib/path.ts | |
parent | cc3c82a0b2816a4e1601d237a130cf7bae953335 (diff) |
Let\'s try again
Diffstat (limited to 'lib/path.ts')
-rw-r--r-- | lib/path.ts | 7 |
1 files changed, 7 insertions, 0 deletions
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}` |