import { normalize } from "https://deno.land/std@0.220.1/url/normalize.ts";
Normalize the URL
, resolving '..'
and '.'
segments and multiple
'/'
s into '//'
after protocol and remaining into '/'
.
Examples
Example 1
Example 1
import { normalize } from "https://deno.land/std@0.220.1/url/normalize.ts";
console.log(normalize("https:///deno.land///std//assert//.//mod.ts").href);
// Outputs: "https://deno.land/std/path/mod.ts"
console.log(normalize("https://deno.land/std/assert/../async/retry.ts").href);
// Outputs: "https://deno.land/std/async/retry.ts"
Parameters
url: string | URL
to be normalized