GeezerVison is showing maxgraph.github.io — UrlConverter | @maxgraph/core
Converts relative and absolute URLs to absolute URLs with protocol and domain.
Constructors
constructor
-
new UrlConverter(): UrlConverter
Properties
baseDomain
baseDomain: string | null = null
Specifies the base domain to be used as a prefix for absolute URLs.
baseUrl
baseUrl: string | null = 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.
Returns string
getBaseDomain
-
getBaseDomain(): string | null
getBaseUrl
-
getBaseUrl(): string | null
isRelativeUrl
-
isRelativeUrl(url: string): boolean | ""
Returns true if the given URL is relative.
Returns boolean | ""
setBaseDomain
-
setBaseDomain(value: string): void
setBaseUrl
-
setBaseUrl(value: string): void
setEnabled
-
setEnabled(value: boolean): void
updateBaseUrl
-
Private helper function to update the base URL.
Returns void
On This Page
Constructors
Properties
Methods