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

yoursunny / NDNts / 17702548934

13 Sep 2025 10:01PM UTC coverage: 95.499% (-0.02%) from 95.514%
17702548934

push

github

yoursunny
mk: upgrade to TypeScript 5.9

4080 of 4329 branches covered (94.25%)

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

3 existing lines in 1 file now uncovered.

15085 of 15796 relevant lines covered (95.5%)

6843.71 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>(
487,058✔
2
    T: new(ab: ArrayBufferLike, offset?: number, length?: number) => T,
487,058✔
3
    a: ArrayBufferLike | ArrayBufferView,
487,058✔
4
): T {
487,058✔
5
  if (a instanceof T) {
487,058✔
6
    return a;
54✔
7
  }
54✔
8
  if ("buffer" in a) {
487,058✔
9
    return new T(a.buffer, a.byteOffset, a.byteLength);
486,750✔
10
  }
486,750✔
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);
486,752✔
22
}
486,752✔
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,159✔
27
    return a as Uint8Array<ArrayBuffer>;
7,159✔
28
  }
7,159!
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