From fcd45613c0185bf1b7b9ad111b56943ca757ddba Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 13 May 2019 18:18:59 -0400 Subject: [PATCH] pump: pump should return a single stream instead of an array. (#35238) * Pump signature now returns a single stream instead of an array of streams. * pump: Updates version and adds author --- types/pump/index.d.ts | 8 ++++---- types/pump/pump-tests.ts | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/types/pump/index.d.ts b/types/pump/index.d.ts index 6e8cc7fc8e..456860fbf8 100644 --- a/types/pump/index.d.ts +++ b/types/pump/index.d.ts @@ -1,14 +1,14 @@ -// Type definitions for pump 1.0 +// Type definitions for pump 1.1 // Project: https://github.com/mafintosh/pump -// Definitions by: Tomek Łaziuk +// Definitions by: Tomek Łaziuk , Jason Cordial // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -declare function pump(streams: pump.Stream[], callback?: pump.Callback): pump.Stream[]; +declare function pump(streams: pump.Stream[], callback?: pump.Callback): pump.Stream; // callback have to be passed as last argument -declare function pump(...streams: Array): pump.Stream[]; +declare function pump(...streams: Array): pump.Stream; declare namespace pump { type Callback = (err: Error) => any; diff --git a/types/pump/pump-tests.ts b/types/pump/pump-tests.ts index cf3393de21..77de4983e5 100644 --- a/types/pump/pump-tests.ts +++ b/types/pump/pump-tests.ts @@ -47,6 +47,8 @@ setTimeout(() => { throw new Error('timeout'); }, 5000); +// $ExpectType Stream pump(createReadStream('/dev/random'), toHex(), createWriteStream('/dev/null')); +// $ExpectType Stream pump([createReadStream('/dev/random'), toHex(), createWriteStream('/dev/null')]);