Variable urlPartsShapeConst

urlPartsShape: ShapeDefinition<{
    fullPath: string;
    hash: string;
    host: string;
    hostname: string;
    href: string;
    origin: string;
    password: string;
    pathname: string;
    paths: string[];
    port: string;
    protocol: string;
    search: string;
    searchParams: ShapeDefinition<ShapeIndexedKeys<[{
        keys: string;
        required: true;
        values: string[];
    }]>, false>;
    username: string;
}, false> = ...

Shape definition for UrlParts for use with the object-shape-tester package.

Type declaration

  • fullPath: string

    Includes:

    • Pathname
    • Search
    • Hash
  • hash: string

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

  • host: string

    Includes:

    • Hostname
    • Port
  • hostname: string

    Domain, subdomains, and TLD (.com).

  • href: string

    The full url string.

  • origin: string

    Includes:

    • Protocol
    • Hostname
    • Port
  • password: string

    Infrequently used password part of a url.

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

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

  • paths: string[]

    Each path part of the pathname.

  • port: string

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

  • protocol: string

    Http, https, wss, etc.

  • search: string

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

  • searchParams: ShapeDefinition<ShapeIndexedKeys<[{
        keys: string;
        required: true;
        values: string[];
    }]>, false>

    An object representation of the parameters contained within the search string. If none exist, it will be an empty object.

  • username: string

    Infrequently used username part of a url.

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