Skip to content

Commit 741270c

Browse files
committed
correct encodeFilePath
1 parent 2eb2efc commit 741270c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export const decodeFilePath = (unique: string) => decodeURIComponent(unique.replace('-', '.'));
1+
// Notice, no need to handle . or : specifically as decodeURIComponent does handle these. [NL]
2+
export const decodeFilePath = (path: string) => decodeURIComponent(path);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export const encodeFilePath = (path: string) => encodeURIComponent(path).replaceAll('.', '-');
1+
export const encodeFilePath = (path: string) => encodeURIComponent(path).replaceAll('.', '%2E').replaceAll(':', '%3A');
22

33
export const aliasToPath = (path: string) => encodeFilePath(path);

0 commit comments

Comments
 (0)