diff options
author | Bhumij Gupta <bhumijgupta@gmail.com> | 2020-11-06 06:58:00 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-06 12:28:00 +1100 |
commit | 2259e99aefb0fd77fca8399a45af151f4d969383 (patch) | |
tree | 96614d848995f70e4cdccabf2a569629fd77179a /std/node | |
parent | 6162807a7e8971524c9d8df746916be83d81b649 (diff) |
docs(std/node/url): Added JSDocs for std/node/url (#7805)
Diffstat (limited to 'std/node')
-rw-r--r-- | std/node/url.ts | 5 |
1 files changed, 5 insertions, 0 deletions
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 |