LCOV - code coverage report
Current view: top level - dashql-app/src/platform/file - web_file_downloader.ts Coverage Total Hit
Test: DashQL 915828b Lines: 100.0 % 13 13
Test Date: 2026-11-06 19:30:32

            Line data    Source code
       1              : import { FileDownloader } from './file_downloader.js';
       2              : 
       3            1 : export class WebFileDownloader implements FileDownloader {
       4            1 :     async downloadBufferAsFile(uint8Array: Uint8Array, filename: string): Promise<void> {
       5              :         // Create a Blob from the Uint8Array
       6            1 :         const blob = new Blob([uint8Array as BlobPart], { type: 'application/octet-stream' });
       7              :         // Create a temporary URL for the Blob
       8            1 :         const url = URL.createObjectURL(blob);
       9              :         // Create an anchor element and trigger the download
      10            1 :         const a = document.createElement('a');
      11            1 :         a.href = url;
      12            1 :         a.download = filename;
      13            1 :         document.body.appendChild(a);
      14            1 :         a.click();
      15              :         // Clean up after download
      16            1 :         document.body.removeChild(a);
      17              :         // Release blob memory
      18            1 :         URL.revokeObjectURL(url);
      19            1 :     }
      20            1 : }
        

Generated by: LCOV version 2.0-1