fix: fix pipe types
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user