Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

std/url/normalize.ts>normalize

The Deno Standard Library
Latest
function normalize
import { normalize } from "https://deno.land/std@0.224.0/url/normalize.ts";

Normalizes the URL or URL string, resolving .. and . segments. Multiple sequential /s are resolved into a single /.

Examples

Example 1

import { normalize } from "https://deno.land/std@0.224.0/url/normalize.ts";

normalize("https:///deno.land///std//assert//.//mod.ts").href;
// "https://deno.land/std/path/mod.ts"

normalize("https://deno.land/std/assert/../async/retry.ts").href;
// "https://deno.land/std/async/retry.ts"

Parameters

url: string | URL

URL to be normalized.

Returns

Normalized URL.