2024-01-01 21:11:32 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-09-01 08:08:15 +00:00
|
|
|
// This module is browser compatible.
|
|
|
|
|
|
|
|
/**
|
2024-04-17 04:49:49 +00:00
|
|
|
* Utilities for working with
|
|
|
|
* {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/URL | URL}s.
|
2023-09-01 08:08:15 +00:00
|
|
|
*
|
2024-04-17 04:49:49 +00:00
|
|
|
* ```ts
|
2024-06-05 21:16:52 +00:00
|
|
|
* import { basename, join, normalize } from "@std/url";
|
refactor(assert,async,bytes,cli,collections,crypto,csv,data-structures,datetime,dotenv,encoding,expect,fmt,front-matter,fs,html,http,ini,internal,io,json,jsonc,log,media-types,msgpack,net,path,semver,streams,testing,text,toml,ulid,url,uuid,webgpu,yaml): import from `@std/assert` (#5199)
* refactor: import from `@std/assert`
* update
2024-06-30 08:30:10 +00:00
|
|
|
* import { assertEquals } from "@std/assert";
|
2024-04-17 04:49:49 +00:00
|
|
|
*
|
2024-06-05 21:16:52 +00:00
|
|
|
* const url = new URL("https:///deno.land///std//assert//.//mod.ts");
|
|
|
|
* const normalizedUrl = normalize(url);
|
2024-04-17 04:49:49 +00:00
|
|
|
*
|
2024-06-05 21:16:52 +00:00
|
|
|
* assertEquals(normalizedUrl.href, "https://deno.land/std/assert/mod.ts");
|
|
|
|
* assertEquals(basename(normalizedUrl), "mod.ts");
|
2024-04-17 04:49:49 +00:00
|
|
|
*
|
2024-06-05 21:16:52 +00:00
|
|
|
* const joinedUrl = join(normalizedUrl, "..", "..", "async", "retry.ts");
|
2024-04-17 04:49:49 +00:00
|
|
|
*
|
2024-06-05 21:16:52 +00:00
|
|
|
* assertEquals(joinedUrl.href, "https://deno.land/std/async/retry.ts");
|
2024-04-17 04:49:49 +00:00
|
|
|
* ```
|
|
|
|
*
|
2024-08-02 02:53:11 +00:00
|
|
|
* @deprecated Use functions from
|
|
|
|
* {@linkcode https://jsr.io/@std/path/doc/posix/~ | @std/path/posix}
|
|
|
|
* instead (examples included). `@std/url` will be removed in the future.
|
|
|
|
*
|
2023-09-01 08:08:15 +00:00
|
|
|
* @module
|
|
|
|
*/
|
|
|
|
|
|
|
|
export * from "./basename.ts";
|
|
|
|
export * from "./dirname.ts";
|
|
|
|
export * from "./extname.ts";
|
|
|
|
export * from "./join.ts";
|
|
|
|
export * from "./normalize.ts";
|