Compare commits

...

2 Commits

Author SHA1 Message Date
7063b80bdd Added download blob function
All checks were successful
Build / Build NPM Project (push) Successful in 22s
Build / Tag Version (push) Successful in 5s
2024-07-19 08:33:26 -04:00
f3049160b6 Fixed imports
All checks were successful
Build / Build NPM Project (push) Successful in 21s
Build / Tag Version (push) Successful in 4s
2024-07-19 00:26:30 -04:00
4 changed files with 9 additions and 3 deletions

View File

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

View File

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

View File

@ -1,5 +1,5 @@
import {clean} from './objects'; import {clean} from './objects';
import {PromiseProgress} from './promise-progress.ts'; import {PromiseProgress} from './promise-progress';
export type DecodedResponse<T> = Response & {data?: T} export type DecodedResponse<T> = Response & {data?: T}

View File

@ -1,4 +1,4 @@
import {PromiseProgress} from './promise-progress.ts'; import {PromiseProgress} from './promise-progress';
export type UploadOptions = { export type UploadOptions = {
url: string; url: string;