Skip to content

Commit

Permalink
fix: url fileURLToPath polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie committed Aug 16, 2024
1 parent 295f3f7 commit c48ebbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/http/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var ClientRequest = require("./lib/request");
var response = require("./lib/response");
var extend = require("xtend");
var statusCodes = require("builtin-status-codes");
var url = require("url");
var url = require("url/");

var http = exports;

Expand Down
6 changes: 3 additions & 3 deletions modules/url/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function getPathFromURLPosix(url) {
return decodeURIComponent(pathname);
}

function fileURLToPath(path) {
url.fileURLToPath = function (path) {
if (typeof path === "string") {
path = url.parse(path);
} else if (!isURLInstance(path)) {
Expand All @@ -35,6 +35,6 @@ function fileURLToPath(path) {
throw new TypeError("The URL must be of scheme file");
}
return getPathFromURLPosix(path);
}
};

module.exports = { ...url, fileURLToPath };
module.exports = url;

0 comments on commit c48ebbe

Please sign in to comment.