add helper function to get value of baseurl

This commit is contained in:
Jacob Overgaard
2022-11-24 14:59:06 +01:00
parent f4b03c03fe
commit fbe02f4a2f
2 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
export function baseUrl(): string {
if (typeof document !== 'undefined') {
const baseElems = document.getElementsByTagName('base');
if (baseElems.length) {
return baseElems[0].href.slice(0, -1);
}
}
return '';
}

View File

@@ -1 +1,2 @@
export * from './baseUrl';
export * from './umbraco-path';