• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / loaders.gl / 24139120841

08 Apr 2026 01:53PM UTC coverage: 65.319% (+30.2%) from 35.137%
24139120841

push

github

web-flow
chore: Replace puppeteer with playwright (#3350)

14216 of 18890 branches covered (75.26%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 1 file covered. (100.0%)

3248 existing lines in 369 files now uncovered.

73509 of 115413 relevant lines covered (63.69%)

5763.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

24.39
/modules/core/src/lib/fetch/read-array-buffer.ts
UNCOV
1
// loaders.gl
×
UNCOV
2
// SPDX-License-Identifier: MIT
×
UNCOV
3
// Copyright (c) vis.gl contributors
×
UNCOV
4

×
UNCOV
5
/**
×
UNCOV
6
 * Reads a chunk from a random access file
×
UNCOV
7
 * @param file
×
UNCOV
8
 * @param start
×
UNCOV
9
 * @param length
×
UNCOV
10
 * @returns
×
UNCOV
11
 */
×
12
export async function readArrayBuffer(
1✔
13
  file: Blob | ArrayBuffer | string,
×
14
  start: number,
×
15
  length: number
×
16
): Promise<ArrayBuffer> {
×
17
  // TODO - we can do better for ArrayBuffer and string
×
18
  if (!(file instanceof Blob)) {
×
19
    file = new Blob([file]);
×
20
  }
×
21
  const slice = file.slice(start, start + length);
×
22
  return await readBlob(slice);
×
23
}
×
24

1✔
25
/**
1✔
26
 * Read a slice of a Blob or File, without loading the entire file into memory
1✔
27
 * The trick when reading File objects is to read successive "slices" of the File
1✔
28
 * Per spec https://w3c.github.io/FileAPI/, slicing a File only updates the start and end fields
1✔
29
 * Actually reading from file happens in `readAsArrayBuffer`
1✔
30
 * @param blob to read
1✔
31
 */
1✔
32
export async function readBlob(blob: Blob): Promise<ArrayBuffer> {
1✔
33
  return await new Promise((resolve, reject) => {
×
34
    const fileReader = new FileReader();
×
35
    fileReader.onload = (event: ProgressEvent<FileReader>) =>
×
36
      resolve(event?.target?.result as ArrayBuffer);
×
37
    // TODO - reject with a proper Error
×
38
    fileReader.onerror = (error: ProgressEvent<FileReader>) => reject(error);
×
39
    fileReader.readAsArrayBuffer(blob);
×
40
  });
×
41
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc