From 814b583fb0aa585803554cd576fea0cf693744a9 Mon Sep 17 00:00:00 2001 From: Kir_Antipov Date: Thu, 4 Jan 2024 10:31:14 +0000 Subject: [PATCH] Fixed the return type of `isReadableStream` Previously, it would return `undefined` instead of `false` when `stream` was undefined. --- src/utils/net/http-request-body.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/net/http-request-body.ts b/src/utils/net/http-request-body.ts index e586018..2255370 100644 --- a/src/utils/net/http-request-body.ts +++ b/src/utils/net/http-request-body.ts @@ -50,7 +50,7 @@ export function isStreamableHttpRequestBody(body: unknown): body is Blob | Buffe function isReadableStream(stream: unknown): stream is NodeJS.ReadableStream { const s = stream as NodeJS.ReadableStream; return ( - s && + !!s && typeof s.read === "function" && typeof s.pause === "function" && typeof s.resume === "function" &&