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

nikelborm / fetch-github-folder / 12823494188

17 Jan 2025 05:51AM UTC coverage: 55.378%. Remained the same
12823494188

push

github

nikelborm
quick save: Fri Jan 17 06:13:09 MSK 2025

53 of 64 branches covered (82.81%)

Branch coverage included in aggregate %.

39 of 89 new or added lines in 9 files covered. (43.82%)

24 existing lines in 4 files now uncovered.

328 of 624 relevant lines covered (52.56%)

2.37 hits per line

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

78.26
/src/castToReadableStream.ts
1
import { Effect, gen } from 'effect/Effect';
1✔
2
import { Readable } from 'node:stream';
3
import { ReadableStream } from 'node:stream/web';
4
import { TaggedErrorVerifyingCause } from './TaggedErrorVerifyingCause.js';
5

6
export const CastToReadableStream = <E, R>(self: Effect<unknown, E, R>) =>
1✔
7
  gen(function* () {
3✔
8
    const data = yield* self;
3✔
9

10
    if (data instanceof ArrayBuffer || data instanceof Buffer)
3✔
11
      return new Readable({
3✔
12
        read() {
3✔
13
          this.push(data);
3✔
14
          this.push(null);
3✔
15
        },
3✔
16
      });
3!
17

18
    if (data instanceof ReadableStream) return Readable.fromWeb(data);
×
19

20
    if (data instanceof Readable) return data;
×
21

NEW
22
    return yield* new FailedToCastDataToReadableStream();
×
23
  });
×
24

25
export class FailedToCastDataToReadableStream extends TaggedErrorVerifyingCause()(
1✔
26
  'FailedToCastDataToReadableStream',
1✔
27
  'Error: Failed to cast data to Readable stream, type of argument is not familiar',
1✔
28
) {}
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