summaryrefslogtreecommitdiff
path: root/std/path/posix.ts
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2020-07-29 23:23:09 +0100
committerGitHub <noreply@github.com>2020-07-29 18:23:09 -0400
commit6afe7bbd395eb34febd25bda48c5cd82f0a4f8b3 (patch)
treea6d216b89d14306d2b7b0926a1e554f0a957860a /std/path/posix.ts
parent1b60840f286bc0203a3bd2900f67557a8ff2c3f6 (diff)
fix(std/path): Percent-decode in fromFileUrl() (#6913)
Diffstat (limited to 'std/path/posix.ts')
-rw-r--r--std/path/posix.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/std/path/posix.ts b/std/path/posix.ts
index 3c4262203..fca7f081b 100644
--- a/std/path/posix.ts
+++ b/std/path/posix.ts
@@ -435,6 +435,6 @@ export function parse(path: string): ParsedPath {
* are ignored.
*/
export function fromFileUrl(url: string | URL): string {
- return (url instanceof URL ? url : new URL(url)).pathname
- .replace(/^\/*([A-Za-z]:)(\/|$)/, "$1/");
+ return decodeURIComponent((url instanceof URL ? url : new URL(url)).pathname
+ .replace(/^\/*([A-Za-z]:)(\/|$)/, "$1/"));
}