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

            Line data    Source code
       1            1 : export async function nativeProxyFetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response> {
       2            1 :     const request = new Request(input, init);
       3            1 :     const bridge = globalThis.dashqlElectron;
       4            1 :     if (bridge === undefined) return await fetch(request);
       5              : 
       6            1 :     const headers: Array<[string, string]> = [];
       7            1 :     request.headers.forEach((value, name) => headers.push([name, value]));
       8            1 :     const response = await bridge.nativeProxyRequest({
       9            1 :         body: new Uint8Array(await request.arrayBuffer()),
      10            1 :         headers,
      11            1 :         method: request.method,
      12            1 :         url: request.url,
      13            1 :     }) as {body: Uint8Array; headers: Array<[string, string]>; status: number; statusText: string};
      14            1 :     return new Response(new Uint8Array(response.body), {
      15            1 :         headers: response.headers,
      16            1 :         status: response.status,
      17            1 :         statusText: response.statusText,
      18            1 :     });
      19            1 : }
        

Generated by: LCOV version 2.0-1