Added download blob function
All checks were successful
Build / Build NPM Project (push) Successful in 22s
Build / Tag Version (push) Successful in 5s

This commit is contained in:
Zakary Timson 2024-07-19 08:33:26 -04:00
parent f3049160b6
commit 7063b80bdd
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@ztimson/utils",
"version": "0.13.2",
"version": "0.13.3",
"description": "Utility library",
"author": "Zak Timson",
"license": "MIT",

View File

@ -6,3 +6,9 @@ export function download(href: any, name: string) {
a.click();
document.body.removeChild(a);
}
export function downloadBlob(blob: Blob, name: string) {
const url = URL.createObjectURL(blob);
download(url, name);
URL.revokeObjectURL(url);
}