Class UrlConverter

Converts relative and absolute URLs to absolute URLs with protocol and domain.

Constructors

Properties

baseDomain: null | string = null

Specifies the base domain to be used as a prefix for absolute URLs.

baseUrl: null | string = null

Specifies the base URL to be used as a prefix for relative URLs.

enabled: boolean = true

Specifies if the converter is enabled. Default is true.

Methods

  • Converts the given URL to an absolute URL with protol and domain. Relative URLs are first converted to absolute URLs.

    Parameters

    • url: string

    Returns string

  • Returns true if the given URL is relative.

    Parameters

    • url: string

    Returns boolean | ""

  • Private helper function to update the base URL.

    Returns void