added downloadBlob function

This commit is contained in:
Djeeberjr 2025-10-20 14:29:09 +02:00
parent 4abbd844d2
commit 141c1aa9cb

View File

@ -0,0 +1,8 @@
export function downloadBlob(filename: string, content: string, mimeType = "text/plain") {
const blob = new Blob([content], { type: mimeType });
const a = document.createElement("a");
a.href = URL.createObjectURL(blob);
a.download = filename;
a.click();
URL.revokeObjectURL(a.href);
}