Add trust center references

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-09-19 17:26:17 +02:00
parent 8b7b1cadf7
commit c56563a850
33 changed files with 6187 additions and 56 deletions

View File

@@ -20,3 +20,16 @@ export function downloadFile(url: string | undefined | null, filename: string) {
link.click();
document.body.removeChild(link);
}
export function safeOpenUrl(url: string) {
try {
const parsedUrl = new URL(url);
if (parsedUrl.protocol === 'http:' || parsedUrl.protocol === 'https:') {
window.open(url, '_blank', 'noopener,noreferrer');
} else {
console.error('Invalid URL protocol. Only HTTP and HTTPS URLs are allowed:', url);
}
} catch (error) {
console.error('Invalid URL format:', url, error);
}
}

View File

@@ -6,7 +6,7 @@ export {
getRiskLikelihoods,
getSeverity,
} from "./risk";
export { withViewTransition, downloadFile } from "./dom";
export { withViewTransition, downloadFile, safeOpenUrl } from "./dom";
export { times, groupBy, isEmpty } from "./array";
export { randomInt } from "./number";
export { getMeasureStateLabel, measureStates } from "./measure";