MCPcopy Create free account
hub / github.com/bytebase/bytebase / toBlob

Function toBlob

frontend/src/react/components/DataExportButton.tsx:126–137  ·  view source on GitHub ↗
(
  { content, filename }: DownloadContent,
  format: ExportFormat
)

Source from the content-addressed store, hash-verified

124};
125
126const 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
139const downloadSingle = (entry: DownloadContent, format: ExportFormat) => {
140 const blob = toBlob(entry, format);

Callers 3

downloadSingleFunction · 0.85
downloadZipFunction · 0.85
useScreenshotFunction · 0.85

Calls 1

getExportFileTypeFunction · 0.85

Tested by

no test coverage detected