From 11ab9a78ca6b1bf454b895aa874ca3f4b203b198 Mon Sep 17 00:00:00 2001 From: Leandro Facchinetti Date: Thu, 2 May 2024 11:08:52 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#68985=20[busboy]?= =?UTF-8?q?=20Add=20`stream.truncated`=20property=20by=20@leafac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/busboy/busboy-tests.ts | 14 +++++++------- types/busboy/index.d.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/types/busboy/busboy-tests.ts b/types/busboy/busboy-tests.ts index 751aaa2ebc6d9e..c4f834a56e8c6a 100644 --- a/types/busboy/busboy-tests.ts +++ b/types/busboy/busboy-tests.ts @@ -21,7 +21,7 @@ const bb = busboy({ bb.addListener("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.addListener("field", (name, value, info) => { @@ -54,7 +54,7 @@ bb.on(Symbol("foo"), foo => { bb.on("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.on("field", (name, value, info) => { @@ -87,7 +87,7 @@ bb.on(Symbol("foo"), foo => { bb.once("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.once("field", (name, value, info) => { @@ -120,7 +120,7 @@ bb.once(Symbol("foo"), foo => { bb.removeListener("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.removeListener("field", (name, value, info) => { @@ -153,7 +153,7 @@ bb.removeListener(Symbol("foo"), foo => { bb.off("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.off("field", (name, value, info) => { @@ -186,7 +186,7 @@ bb.off(Symbol("foo"), foo => { bb.prependListener("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.prependListener("field", (name, value, info) => { @@ -219,7 +219,7 @@ bb.prependListener(Symbol("foo"), foo => { bb.prependOnceListener("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.prependOnceListener("field", (name, value, info) => { diff --git a/types/busboy/index.d.ts b/types/busboy/index.d.ts index ee3bffdf7f7fb0..6873698001be1d 100644 --- a/types/busboy/index.d.ts +++ b/types/busboy/index.d.ts @@ -155,7 +155,7 @@ declare namespace busboy { * @param listener.transferEncoding Contains the 'Content-Transfer-Encoding' value for the file stream. * @param listener.mimeType Contains the 'Content-Type' value for the file stream. */ - file: (name: string, stream: Readable, info: FileInfo) => void; + file: (name: string, stream: Readable & { truncated?: boolean }, info: FileInfo) => void; /** * Emitted for each new non-file field found.