• 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

12.5
/modules/loader-utils/src/lib/node/buffer.ts
UNCOV
1
// loaders.gl
×
UNCOV
2
// SPDX-License-Identifier: MIT
×
UNCOV
3
// Copyright (c) vis.gl contributors
×
UNCOV
4

×
UNCOV
5
// Isolates Buffer references to ensure they are only bundled under Node.js (avoids big webpack polyfill)
×
UNCOV
6
// this file is selected by the package.json "browser" field).
×
UNCOV
7

×
UNCOV
8
/**
×
UNCOV
9
 * Convert Buffer to ArrayBuffer
×
UNCOV
10
 * Converts Node.js `Buffer` to `ArrayBuffer` (without triggering bundler to include Buffer polyfill on browser)
×
UNCOV
11
 * @todo better data type
×
UNCOV
12
 */
×
UNCOV
13
export function toArrayBuffer(buffer) {
×
14
  // TODO - per docs we should just be able to call buffer.buffer, but there are issues
×
15
  if (Buffer.isBuffer(buffer)) {
×
16
    const typedArray = new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.length);
×
17
    return typedArray.slice().buffer;
×
18
  }
×
19
  return buffer;
×
20
}
×
21

1✔
22
/**
1✔
23
 * Convert (copy) ArrayBuffer to Buffer
1✔
24
 */
1✔
25
export function toBuffer(binaryData: ArrayBuffer | Buffer): Buffer {
1✔
26
  if (Buffer.isBuffer(binaryData)) {
×
27
    return binaryData;
×
28
  }
×
29

×
30
  if (ArrayBuffer.isView(binaryData)) {
×
31
    binaryData = binaryData.buffer as ArrayBuffer;
×
32
  }
×
33

×
34
  // TODO - move to loaders.gl/polyfills
×
35
  if (typeof Buffer !== 'undefined' && binaryData instanceof ArrayBuffer) {
×
36
    return Buffer.from(binaryData);
×
37
  }
×
38

×
39
  throw new Error('toBuffer');
×
40
}
×
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