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

yoursunny / NDNts / 17698146300

13 Sep 2025 02:54PM UTC coverage: 95.467% (-0.05%) from 95.514%
17698146300

push

github

yoursunny
mk: upgrade to TypeScript 5.9

4079 of 4329 branches covered (94.22%)

46 of 50 new or added lines in 14 files covered. (92.0%)

6 existing lines in 2 files now uncovered.

15080 of 15796 relevant lines covered (95.47%)

6770.75 hits per line

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

91.67
/pkg/util/src/buffer.ts
1
function asArrayBufferView<T extends ArrayBufferView>(
482,981✔
2
    T: new(ab: ArrayBufferLike, offset?: number, length?: number) => T,
482,981✔
3
    a: ArrayBufferLike | ArrayBufferView,
482,981✔
4
): T {
482,981✔
5
  if (a instanceof T) {
482,981✔
6
    return a;
54✔
7
  }
54✔
8
  if ("buffer" in a) {
482,981✔
9
    return new T(a.buffer, a.byteOffset, a.byteLength);
482,673✔
10
  }
482,673✔
11
  return new T(a);
254✔
12
}
254✔
13

14
/** Convert (Shared)ArrayBuffer(View) to Uint8Array. */
15
export function asUint8Array(a: ArrayBufferLike | ArrayBufferView): Uint8Array {
1✔
16
  return asArrayBufferView(Uint8Array, a);
306✔
17
}
306✔
18

19
/** Convert (Shared)ArrayBuffer(View) to DataView. */
20
export function asDataView(a: ArrayBufferLike | ArrayBufferView): DataView {
1✔
21
  return asArrayBufferView(DataView, a);
482,675✔
22
}
482,675✔
23

24
/** Convert Uint8Array&lt;(Shared)ArrayBuffer&gt; to Uint8Array<ArrayBuffer>. */
25
export function asBufferSource(a: Uint8Array): BufferSource {
1✔
26
  if (a.buffer instanceof ArrayBuffer) {
7,145✔
27
    return a as Uint8Array<ArrayBuffer>;
7,145✔
28
  }
7,145!
NEW
29
  return new Uint8Array(a);
×
NEW
30
}
×
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