All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 5m57s
18 lines
393 B
JavaScript
18 lines
393 B
JavaScript
const SITE_URL = "https://minegeo.site";
|
|
function isInternal(value) {
|
|
try {
|
|
return new URL(value).origin === SITE_URL;
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|
|
function isExternal(value) {
|
|
try {
|
|
const url = new URL(value);
|
|
return url.protocol === "https:" && !url.username && !url.password;
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|
|
module.exports = { SITE_URL, isInternal, isExternal };
|