variable / @typed/navigation/_core

getUrl

Resolves a path or URL value against an absolute origin.

Package version
1.0.0-beta.7
Category
URL resolution
Since
1.0.0

Import

import { getUrl } from "@typed/navigation/_core";

Signatures

export declare const getUrl: (origin: string, urlOrPath: string | URL) => URL;

Why

Provider adapters need one URL-normalization rule before computing sameDocument or committing history.

Ownership and lifetime

This synchronous helper acquires no resources. Native URL construction errors are thrown; provider code uses its internal Effect wrapper when a NavigationError channel is required.

Examples

import { getUrl } from "@typed/navigation/_core"

const url = getUrl("https://example.com", "/account")

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source