(
{ content, filename }: DownloadContent,
format: ExportFormat
)
| 124 | }; |
| 125 | |
| 126 | const toBlob = ( |
| 127 | { content, filename }: DownloadContent, |
| 128 | format: ExportFormat |
| 129 | ) => { |
| 130 | const isZip = filename.endsWith(".zip"); |
| 131 | const fileType = isZip ? "application/zip" : getExportFileType(format); |
| 132 | const buffer = content.buffer.slice( |
| 133 | content.byteOffset, |
| 134 | content.byteOffset + content.byteLength |
| 135 | ) as ArrayBuffer; |
| 136 | return new Blob([buffer], { type: fileType }); |
| 137 | }; |
| 138 | |
| 139 | const downloadSingle = (entry: DownloadContent, format: ExportFormat) => { |
| 140 | const blob = toBlob(entry, format); |
no test coverage detected