diff --git a/lib/internal/url.js b/lib/internal/url.js index 16a453c7845a30..f471b68301da35 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -857,6 +857,9 @@ class URL { FunctionPrototypeBind(onParsePortComplete, this)); } + /** + * @returns {string} + */ get pathname() { const ctx = this[context]; if (this[cannotBeBase]) @@ -1312,6 +1315,10 @@ function urlToHttpOptions(url) { const forwardSlashRegEx = /\//g; +/** + * @param {URL} url + * @returns {string} + */ function getPathFromURLWin32(url) { const hostname = url.hostname; let pathname = url.pathname; @@ -1365,6 +1372,10 @@ function getPathFromURLPosix(url) { return decodeURIComponent(pathname); } +/** + * @param {string | URL} path + * @returns {string} + */ function fileURLToPath(path) { if (typeof path === 'string') path = new URL(path);