Added download blob function
This commit is contained in:
		| @@ -1,6 +1,6 @@ | ||||
| { | ||||
| 	"name": "@ztimson/utils", | ||||
| 	"version": "0.13.2", | ||||
| 	"version": "0.13.3", | ||||
| 	"description": "Utility library", | ||||
| 	"author": "Zak Timson", | ||||
| 	"license": "MIT", | ||||
|   | ||||
| @@ -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); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user