Skip to content

Commit

Permalink
fix: stream type error.
Browse files Browse the repository at this point in the history
  • Loading branch information
hezhengxu2018 committed Sep 5, 2024
1 parent 63d610b commit ce71b9f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/port/controller/package/DownloadPackageVersionTar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PassThrough } from 'node:stream';
import { pipeline } from 'node:stream';
import {
NotFoundError,
} from 'egg-errors';
Expand Down Expand Up @@ -76,10 +75,7 @@ export class DownloadPackageVersionTarController extends AbstractController {
const tgzStream = await this.getTgzProxyStream(ctx, fullname, version);
this.packageManagerService.plusPackageVersionCounter(fullname, version);
const passThroughRemoteStream = new PassThrough();
pipeline(
tgzStream,
passThroughRemoteStream,
);
tgzStream.pipe(passThroughRemoteStream);
ctx.attachment(`${filenameWithVersion}.tgz`);
return passThroughRemoteStream;
}
Expand Down

0 comments on commit ce71b9f

Please sign in to comment.