normalizeOrigins
Normalizes origins to scheme://host[:port] form.
Normalizes origins to scheme://host[:port] form.
Import#
ts
import { normalizeOrigins } from "@shadow-js/dusk/server";
Signature#
ts
function normalizeOrigins(origins: readonly string[]): Set<string>
Parameters#
| Name | Description |
|---|---|
origins |
Origins as configured. |
Returns#
The set of normalized origins.
Throws#
- TypeError when an entry is not a valid http(s) origin.
Examples#
ts
normalizeOrigins(["https://App.example/path"]); // Set { "https://app.example" }