10 lines
214 B
TypeScript
10 lines
214 B
TypeScript
/**
|
|
* Extract the current web page's base url
|
|
* @returns base url of the page
|
|
*/
|
|
export function getBaseUrl(): string {
|
|
if (typeof window !== 'undefined') {
|
|
return window.location.origin
|
|
}
|
|
return ''
|
|
}
|