Const
Readonly
fullPath: stringIncludes:
Readonly
hash: stringEverything after the hash (#), including the hash itself. If none exist, this will be an empty string.
Readonly
host: stringIncludes:
Readonly
hostname: stringDomain, subdomains, and TLD (.com).
Readonly
href: stringThe full url string.
Readonly
origin: stringIncludes:
Readonly
password: stringInfrequently used password part of a url.
Readonly
pathname: stringEverything between origin and search/hash with a leading slash. If none exist, this will be
simply '/'
.
Readonly
paths: string[]Each path part of the pathname.
Readonly
port: stringPort part of the URL. If none exist, this will be an empty string.
Readonly
protocol: stringHttp, https, wss, etc.
Readonly
search: stringEverything after a ?, excluding the hash, including ?
, as a string. If none exist, this
will be an empty string.
Readonly
searchParams: Record<string, string[]>An object representation of the parameters contained within the search string. If none exist, it will be an empty object.
Readonly
username: stringInfrequently used username part of a url.
An example of empty
UrlParts
for convenience's sake.