From 1f9316f84216c21e875a3f098ce8ba230bea1a22 Mon Sep 17 00:00:00 2001 From: Perry Mitchell Date: Mon, 16 May 2022 06:24:57 +0300 Subject: [PATCH] Check Stream global - fixes #304 --- source/operations/putFileContents.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/operations/putFileContents.ts b/source/operations/putFileContents.ts index 1cdab227..72b2ade2 100644 --- a/source/operations/putFileContents.ts +++ b/source/operations/putFileContents.ts @@ -28,7 +28,12 @@ export async function putFileContents( const headers: Headers = { "Content-Type": "application/octet-stream" }; - if (typeof WEB === "undefined" && data instanceof Stream.Readable) { + if ( + typeof WEB === "undefined" && + typeof Stream !== "undefined" && + typeof Stream?.Readable !== "undefined" && + data instanceof Stream.Readable + ) { // Skip, no content-length } else if (contentLength === false) { // Skip, disabled