@layr/browser-navigator
Version:
Provides a navigation system for a Layr app running in a browser
17 lines • 507 B
JavaScript
export function isInternalURL(url) {
if (!(url instanceof URL)) {
url = new URL(url, 'internal:/');
}
if (url.protocol === 'internal:') {
return true;
}
const currentURL = new URL(window.location.href);
if (url.protocol === currentURL.protocol &&
url.username === currentURL.username &&
url.password === currentURL.password &&
url.host === currentURL.host) {
return true;
}
return false;
}
//# sourceMappingURL=utilities.js.map