(content: string, filename: string, )
| 229 | * Helper function to download a script file |
| 230 | */ |
| 231 | export function downloadScript(content: string, filename: string, ): void { |
| 232 | const blob = new Blob([content], { type: 'text/plain' }); |
| 233 | const url = URL.createObjectURL(blob); |
| 234 | const a = document.createElement('a'); |
| 235 | a.href = url; |
| 236 | a.download = filename; |
| 237 | document.body.appendChild(a); |
| 238 | a.click(); |
| 239 | document.body.removeChild(a); |
| 240 | URL.revokeObjectURL(url); |
| 241 | } |
no outgoing calls
no test coverage detected