diff --git a/modules/http/index.js b/modules/http/index.js index 6317e11..66007f3 100644 --- a/modules/http/index.js +++ b/modules/http/index.js @@ -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; diff --git a/modules/url/index.js b/modules/url/index.js index c4706db..95ae2aa 100644 --- a/modules/url/index.js +++ b/modules/url/index.js @@ -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)) { @@ -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;