Add utilities and initial test coverage

This commit is contained in:
beatz174-bit committed 2025-12-01 16:07:31 +10:00
1 parent a86723004b
commit ff0b2959b5
15 files changed
+462 -160

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
export const isOnline = () => {
if (typeof navigator !== 'undefined' && 'onLine' in navigator) {
return navigator.onLine;
}
return true;
};
export const triggerDownload = (blob: Blob, filename: string) => {
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = filename;
link.click();
URL.revokeObjectURL(url);
};