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

yoursunny / NDNts / 13045469972

30 Jan 2025 04:09AM UTC coverage: 95.059% (-0.009%) from 95.068%
13045469972

push

github

yoursunny
psync: pako => CompressionStream

4043 of 4289 branches covered (94.26%)

26 of 36 new or added lines in 6 files covered. (72.22%)

2 existing lines in 1 file now uncovered.

14795 of 15564 relevant lines covered (95.06%)

6918.89 hits per line

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

35.29
/pkg/psync/src/param-zlib.ts
1
import { concatBuffers } from "@ndn/util";
1✔
2
import { collect } from "streaming-iterables";
1✔
3

4
import type { PSyncCodec } from "./codec";
5

6
/** Use zlib compression with PSync. */
7
export const PSyncZlib: PSyncCodec.Compression = {
1✔
8
  async compress(input) {
1✔
NEW
9
    return doTransform(input, new CompressionStream("deflate"));
×
UNCOV
10
  },
×
11
  async decompress(compressed) {
1✔
NEW
12
    return doTransform(compressed, new DecompressionStream("deflate"));
×
UNCOV
13
  },
×
14
};
1✔
15

NEW
16
async function doTransform(input: Uint8Array, tr: TransformStream<Uint8Array, Uint8Array>): Promise<Uint8Array> {
×
NEW
17
  const chunks = await collect(
×
NEW
18
    new Blob([input]).stream()
×
NEW
19
      .pipeThrough(tr) as unknown as AsyncIterable<Uint8Array>,
×
NEW
20
  );
×
NEW
21
  return concatBuffers(chunks);
×
NEW
22
}
×
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