Skip to main content
Foldkit
On this pageFunctions

Url

Functions

fromString

functionsource

Parses a URL string into a Url, returning Option.None if invalid.

(str: string): Option<{
  hash: Option<string>
  host: string
  pathname: string
  port: Option<string>
  protocol: string
  search: Option<string>
}>

toString

functionsource

Serializes a Url back to a string.

(url: {
  hash: Option<string>
  host: string
  pathname: string
  port: Option<string>
  protocol: string
  search: Option<string>
}): string

Constants

Url

constsource

Schema representing a parsed URL with protocol, host, port, pathname, search, and hash fields.

const Url: Struct<{
  hash: OptionFromSelf<typeof String
gt;
host: typeof String$ pathname: typeof String$ port: OptionFromSelf<typeof String
gt;
protocol: typeof String$ search: OptionFromSelf<typeof String
gt;
}>