* Helper function to download a file
(blob: Blob, filename: string)
| 174 | * Helper function to download a file |
| 175 | */ |
| 176 | function downloadFile(blob: Blob, filename: string): void { |
| 177 | const link = document.createElement("a"); |
| 178 | const url = URL.createObjectURL(blob); |
| 179 | |
| 180 | link.setAttribute("href", url); |
| 181 | link.setAttribute("download", filename); |
| 182 | link.style.visibility = "hidden"; |
| 183 | |
| 184 | document.body.appendChild(link); |
| 185 | link.click(); |
| 186 | document.body.removeChild(link); |
| 187 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…