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

nikelborm / fetch-github-folder / 12944300402

24 Jan 2025 06:11AM UTC coverage: 82.596% (-0.2%) from 82.833%
12944300402

push

github

nikelborm
quick save: Fri Jan 24 09:11:36 MSK 2025

73 of 83 branches covered (87.95%)

Branch coverage included in aggregate %.

5 of 8 new or added lines in 2 files covered. (62.5%)

506 of 618 relevant lines covered (81.88%)

4.17 hits per line

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

34.78
/src/writeFileStreamToDestinationPath.ts
1
import { Effect, gen, tryPromise } from 'effect/Effect';
1✔
2
import { createWriteStream } from 'node:fs';
3
import { Readable } from 'node:stream';
4
import { pipeline } from 'node:stream/promises';
5
import { OutputConfigTag } from './configContext.js';
6
import {
7
  TaggedErrorClassWithUnknownCauseAndNoContext,
8
  TaggedErrorVerifyingCause,
9
} from './TaggedErrorVerifyingCause.js';
10

11
export const writeFileStreamToDestinationPath = <E, R>(
1✔
12
  self: Effect<Readable, E, R>,
×
13
) =>
14
  gen(function* () {
×
15
    const fileStream = yield* self;
×
16

17
    const {
×
18
      localPathAtWhichEntityFromRepoWillBeAvailable: localDownloadedFilePath,
×
19
    } = yield* OutputConfigTag;
×
20

21
    yield* tryPromise({
×
22
      try: signal =>
×
23
        pipeline(fileStream, createWriteStream(localDownloadedFilePath), {
×
24
          signal,
×
25
        }),
×
NEW
26
      catch: cause =>
×
NEW
27
        new FailedToWriteFileStreamToDestinationPathError({ cause }),
×
28
    });
×
29
  });
×
30

31
// Extracting to a separate type is required by JSR, so that consumers of the
32
// library will have much faster type inference
33
export type FailedToWriteFileStreamToDestinationPathErrorClass =
34
  TaggedErrorClassWithUnknownCauseAndNoContext<'FailedToWriteFileStreamToDestinationPathError'>;
35

36
export type FailedToWriteFileStreamToDestinationPathError =
37
  InstanceType<FailedToWriteFileStreamToDestinationPathErrorClass>;
38

39
export const FailedToWriteFileStreamToDestinationPathError: FailedToWriteFileStreamToDestinationPathErrorClass =
1✔
40
  TaggedErrorVerifyingCause<{
1✔
41
    cause: unknown;
42
  }>()(
1✔
43
    'FailedToWriteFileStreamToDestinationPathError',
1✔
44
    'Error: Failed to write file stream to destination path',
1✔
45
  );
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