@xylabs/url
v5.0.87
Published
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Readme
@xylabs/url
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Reference
@xylabs/url
Modules
| Module | Description | | ------ | ------ | | index-browser | - | | index-neutral | - | | index-node | - |
index-browser
functions
### <a id="isLocalhost"></a>isLocalhostfunction isLocalhost(hostname: string): boolean;Checks whether a hostname refers to the local machine (localhost, 127.0.0.1, ::1, or *.localhost).
Parameters
| Parameter | Type | Description |
| ------ | ------ | ------ |
| hostname | string | The hostname to check |
Returns
boolean
true if the hostname is a localhost address
variables
### <a id="URL"></a>URLconst URL: (url: string | URL, base?: string | URL) => URL;Browser-specific URL class, aliased from the global URL.
Parameters
| Parameter | Type |
| ------ | ------ |
| url | string | URL |
| base? | string | URL |
Returns
URL
index-neutral
variables
### <a id="URL"></a>URLconst URL: (url: string | URL, base?: string | URL) => URL;Platform-neutral URL class, aliased from the global URL.
Parameters
| Parameter | Type |
| ------ | ------ |
| url | string | URL |
| base? | string | URL |
Returns
URL
index-node
variables
### <a id="URL"></a>URLconst URL: (url: string | URL, base?: string | URL) => URL;Node.js-specific URL class, imported from the node:url module.
Parameters
| Parameter | Type |
| ------ | ------ |
| url | string | URL |
| base? | string | URL |
Returns
URL
Part of sdk-js
Maintainers
License
See the LICENSE file for license details
