variable url

A string-to-URL converter. Returns null if the string is not a URL.

Examples

Example 1

const aUrl = url`https://site.example/`;
aUrl instanceOf URL; // true
aUrl instanceOf IRI; // true

See

Usage

import { url } from ".";