Variable emptyUrlPartsConst

emptyUrlParts: {
    fullPath: string;
    hash: string;
    host: string;
    hostname: string;
    href: string;
    origin: string;
    password: string;
    pathname: string;
    paths: [];
    port: string;
    protocol: string;
    search: string;
    searchParams: {};
    username: string;
} = ...

An example of empty UrlParts for convenience's sake.

Type declaration

  • ReadonlyfullPath: string

    Includes:

    • Pathname
    • Search
    • Hash
  • Readonlyhash: string

    Everything after the hash (#). If none exist, this will be an empty string.

  • Readonlyhost: string

    Includes:

    • Hostname
    • Port
  • Readonlyhostname: string

    Domain, subdomains, and TLD (.com).

  • Readonlyhref: string

    The full url string.

  • Readonlyorigin: string

    Includes:

    • Protocol
    • Hostname
    • Port
  • Readonlypassword: string

    Infrequently used password part of a url.

    BuildUrl('https://anonymous:my-pass@developer.mozilla.org').password === 'my-pass';
    
  • Readonlypathname: string

    Everything between origin and search/hash without a leading slash. If none exist, this will be simply '/'.

  • Readonlypaths: []
  • Readonlyport: string

    Port part of the URL. If none exist, this will be an empty string.

  • Readonlyprotocol: string

    Http, https, wss, etc.

  • Readonlysearch: string

    Everything after a ?, excluding the hash, as a string. If none exist, this will be an empty string.

  • ReadonlysearchParams: {}
    • Readonlyusername: string

      Infrequently used username part of a url.

      BuildUrl('https://anonymous:my-pass@developer.mozilla.org').username ===
      'anonymous';