7 lines
254 B
TypeScript
7 lines
254 B
TypeScript
export function saveCsv(blob: Blob, fileName: string) {
|
|
const url = URL.createObjectURL(blob)
|
|
const anchor = document.createElement('a')
|
|
try { anchor.href = url; anchor.download = fileName; anchor.click() }
|
|
finally { URL.revokeObjectURL(url) }
|
|
}
|