From 2259e99aefb0fd77fca8399a45af151f4d969383 Mon Sep 17 00:00:00 2001 From: Bhumij Gupta Date: Fri, 6 Nov 2020 06:58:00 +0530 Subject: docs(std/node/url): Added JSDocs for std/node/url (#7805) --- std/node/url.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'std') diff --git a/std/node/url.ts b/std/node/url.ts index 70e1645b6..82daa25e9 100644 --- a/std/node/url.ts +++ b/std/node/url.ts @@ -39,6 +39,10 @@ const tabRegEx = /\t/g; const _url = URL; export { _url as URL }; +/** + * Get fully resolved platform-specific file path from the given URL string/ object + * @param path The file URL string or URL object to convert to a path + */ export function fileURLToPath(path: string | URL): string { if (typeof path === "string") path = new URL(path); else if (!(path instanceof URL)) { @@ -108,6 +112,7 @@ function getPathFromURLPosix(url: URL): string { return decodeURIComponent(pathname); } +/** Get fully resolved platform-specific File URL from the given file path */ export function pathToFileURL(filepath: string): URL { let resolved = path.resolve(filepath); // path.resolve strips trailing slashes so we must add them back -- cgit v1.2.3