dirname(url: string | URL): URL
Deprecated
Use
@std/path/dirname
instead. @std/url
will be removed in the future.
Returns the directory path URL of a URL or URL string.
The directory path is the portion of a URL up to but excluding the final path segment. URL queries and hashes are ignored.
Usage
Usage
import { dirname } from "@std/url/dirname"; import { assertEquals } from "@std/assert"; assertEquals(dirname("https://deno.land/std/path/mod.ts"), new URL("https://deno.land/std/path")); assertEquals(dirname(new URL("https://deno.land/std/path/mod.ts")), new URL("https://deno.land/std/path"));
The directory path URL of the URL.