(url: string, filename: string)
| 38 | } |
| 39 | |
| 40 | export function downloadUrl(url: string, filename: string): void { |
| 41 | const a = document.createElement('a'); |
| 42 | a.href = url; |
| 43 | a.download = filename; |
| 44 | a.click(); |
| 45 | } |
| 46 | |
| 47 | export function buildTimestampedFilename(prefix: string, ext: string, date = new Date()): string { |
| 48 | const timestamp = date.toISOString().slice(0, 19).replace(/[:-]/g, ''); |
no outgoing calls
no test coverage detected