fix: fix pipe types

This commit is contained in:
2026-01-15 23:43:41 +08:00
parent 07b4b0618a
commit 94d7d6e8a2

View File

@@ -26,7 +26,7 @@ export const pipeFileStream = (filePath: string, res: http.ServerResponse) => {
* @param readStream 可读流对象 * @param readStream 可读流对象
* @param res HTTP服务器响应对象 * @param res HTTP服务器响应对象
*/ */
export const pipeStream = (readStream: fs.ReadStream, res: http.ServerResponse) => { export const pipeStream = (readStream: fs.ReadStream | Stream.Readable, res: http.ServerResponse) => {
if (isBun) { if (isBun) {
// Bun环境下的流处理方式 // Bun环境下的流处理方式
res.pipe(readStream as any); res.pipe(readStream as any);