URL API
Elide supports the WhatWG URL API Specification; this is the spec you use when you use the global URL class in JavaScript.
Elide's implementation of URL and URLSearchParams are based on JDK 22's URI, URL, and URLDecoder classes.
Classes
URLParse and manipulate URLs🟢 Supported.
URLSearchParamsParse and manipulate URL params🟢 Supported.
URL
The URL class is used as a value class which wraps a standard Uniform Resource Locator, also known as a "URL". URLs have a specific structure and suite of supported components, as opposed to their more general ancestor, URIs.
URLs are strictly validated: when you construct one from a string, it is parsed eagerly, and you will get an error if the provided string is not a valid URL.
URLs, by spec, support the following components:
| Sample Value | Description |
|---|---|---|
| The transport technology in use, including the trailing | |
| The web origin value of the URL; consists of the scheme, domain, and port | |
| The full host string, like | |
| Just the hostname, like | |
| Just the port, like | |
| The path portion of the url | |
| The portion of the URL after | |
| Formatted string version of the whole URL | |
| If there is auth information in the URL (like | |
|
| |
| The portion of the URL after | |
| Parsed |
URLSearchParams
Coming soon.