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

nikelborm / fetch-github-folder / 12884498323

21 Jan 2025 10:01AM UTC coverage: 84.12% (+0.5%) from 83.58%
12884498323

push

github

nikelborm
quick save: Tue Jan 21 13:01:36 MSK 2025

72 of 79 branches covered (91.14%)

Branch coverage included in aggregate %.

516 of 620 relevant lines covered (83.23%)

4.14 hits per line

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

85.71
/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 {
5
  ReturnTypeNoCauseNoStatic,
6
  TaggedErrorVerifyingCause,
7
} from './TaggedErrorVerifyingCause.js';
8

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

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

21
    if (data instanceof ReadableStream) return Readable.fromWeb(data);
1!
22

23
    if (data instanceof Readable) return data;
×
24

25
    return yield* new FailedToCastDataToReadableStream();
×
26
  });
×
27

28
const _Err: ReturnTypeNoCauseNoStatic<'FailedToCastDataToReadableStream'> =
1✔
29
  TaggedErrorVerifyingCause()(
1✔
30
    'FailedToCastDataToReadableStream',
1✔
31
    'Error: Failed to cast data to Readable stream, type of argument is not familiar',
1✔
32
  );
1✔
33

34
export class FailedToCastDataToReadableStream extends _Err {}
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