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

visgl / loaders.gl / 20382848403

19 Dec 2025 09:20PM UTC coverage: 35.219% (+0.1%) from 35.095%
20382848403

push

github

web-flow
feat: Upgrade to handle ArrayBufferLike (#3271)

1190 of 2002 branches covered (59.44%)

Branch coverage included in aggregate %.

157 of 269 new or added lines in 41 files covered. (58.36%)

3 existing lines in 3 files now uncovered.

37536 of 107957 relevant lines covered (34.77%)

0.79 hits per line

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

50.0
/modules/json/src/lib/encoder-utils/utf8-encoder.ts
1
// loaders.gl
1✔
2
// SPDX-License-Identifier: MIT
1✔
3

1✔
4
import {ensureArrayBuffer} from '@loaders.gl/loader-utils';
1✔
5

1✔
6
/* global TextEncoder */
1✔
7
export class Utf8ArrayBufferEncoder {
1✔
8
  private readonly chunkSize: number;
1!
9
  private strings: string[] = [];
×
10
  private totalLength = 0;
×
11
  private textEncoder: TextEncoder = new TextEncoder();
×
12

1✔
13
  constructor(chunkSize: number) {
1✔
14
    this.chunkSize = chunkSize;
×
15
  }
×
16

1✔
17
  push(...strings: string[]): void {
1✔
18
    for (const string of strings) {
×
19
      this.strings.push(string);
×
20
      this.totalLength += string.length;
×
21
    }
×
22
  }
×
23

1✔
24
  isFull(): boolean {
1✔
25
    return this.totalLength >= this.chunkSize;
×
26
  }
×
27

1✔
28
  getArrayBufferBatch(): ArrayBuffer {
1✔
NEW
29
    return ensureArrayBuffer(this.textEncoder.encode(this.getStringBatch()).buffer);
×
UNCOV
30
  }
×
31

1✔
32
  getStringBatch(): string {
1✔
33
    const stringChunk = this.strings.join('');
×
34
    this.strings = [];
×
35
    this.totalLength = 0;
×
36
    return stringChunk;
×
37
  }
×
38
}
1✔
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