Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UrlConverter

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

Hierarchy

  • UrlConverter

Index

Constructors

constructor

Properties

baseDomain

baseDomain: null | string = null

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

baseUrl

baseUrl: null | string = null

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

enabled

enabled: boolean = true

Specifies if the converter is enabled. Default is true.

Methods

convert

  • convert(url: string): string
  • 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

getBaseDomain

  • getBaseDomain(): null | string

getBaseUrl

  • getBaseUrl(): null | string

isEnabled

  • isEnabled(): boolean

isRelativeUrl

  • isRelativeUrl(url: string): boolean | ""
  • Returns true if the given URL is relative.

    Parameters

    • url: string

    Returns boolean | ""

setBaseDomain

  • setBaseDomain(value: string): void

setBaseUrl

  • setBaseUrl(value: string): void

setEnabled

  • setEnabled(value: boolean): void

updateBaseUrl

  • updateBaseUrl(): void

Generated using TypeDoc