From 58dea12785dc756ee8a363b42a24c61c69c7c2c0 Mon Sep 17 00:00:00 2001 From: Paul Taylor Date: Thu, 7 Oct 2021 04:34:51 -0500 Subject: [PATCH] fix(pipethrough): fix Iterable/AsyncIterable pipeThrough signature (#338) --- spec/asynciterable/inference-spec.ts | 4 ++-- spec/iterable/inference-spec.ts | 4 ++-- src/asynciterable/todomstream.ts | 2 +- src/iterable/todomstream.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/asynciterable/inference-spec.ts b/spec/asynciterable/inference-spec.ts index deddd551..77726de6 100644 --- a/spec/asynciterable/inference-spec.ts +++ b/spec/asynciterable/inference-spec.ts @@ -32,11 +32,11 @@ describe('AsyncIterable type inference', () => { if (TEST_DOM_STREAMS) { test('#pipeThrough type inference is correct with transform stream', () => { - const source = of(0, 1, 2).pipeThrough(new TransformStream()); + const source = of(0, 1, 2).pipeThrough(new TransformStream()); expect(source).toEqualStream([0, 1, 2]); }); test('#pipeThrough type inference is correct with transform stream and pipe options', () => { - const source = of(0, 1, 2).pipeThrough(new TransformStream(), { + const source = of(0, 1, 2).pipeThrough(new TransformStream(), { preventClose: false, }); expect(source).toEqualStream([0, 1, 2]); diff --git a/spec/iterable/inference-spec.ts b/spec/iterable/inference-spec.ts index 948a224c..a2d2d269 100644 --- a/spec/iterable/inference-spec.ts +++ b/spec/iterable/inference-spec.ts @@ -33,11 +33,11 @@ describe('Iterable type inference', () => { if (TEST_DOM_STREAMS) { test('#pipeThrough type inference is correct with writable stream', () => { - const source = of(0, 1, 2).pipeThrough(new TransformStream()); + const source = of(0, 1, 2).pipeThrough(new TransformStream()); expect(source).toEqualStream([0, 1, 2]); }); test('#pipeThrough type inference is correct with writable stream and pipe options', () => { - const source = of(0, 1, 2).pipeThrough(new TransformStream(), { + const source = of(0, 1, 2).pipeThrough(new TransformStream(), { preventClose: false, }); expect(source).toEqualStream([0, 1, 2]); diff --git a/src/asynciterable/todomstream.ts b/src/asynciterable/todomstream.ts index aeb8e475..cb052851 100644 --- a/src/asynciterable/todomstream.ts +++ b/src/asynciterable/todomstream.ts @@ -267,6 +267,6 @@ declare module '../asynciterable/asynciterablex' { pipeThrough>( duplex: { writable: WritableStream; readable: R }, options?: StreamPipeOptions - ): ReadableStream; + ): R; } } diff --git a/src/iterable/todomstream.ts b/src/iterable/todomstream.ts index 0c9c4482..000d24e6 100644 --- a/src/iterable/todomstream.ts +++ b/src/iterable/todomstream.ts @@ -85,6 +85,6 @@ declare module '../iterable/iterablex' { pipeThrough>( duplex: { writable: WritableStream; readable: R }, options?: StreamPipeOptions - ): ReadableStream; + ): R; } }