Skip to content

Commit

Permalink
fix(pipethrough): fix Iterable/AsyncIterable pipeThrough signature (#338
Browse files Browse the repository at this point in the history
)
  • Loading branch information
trxcllnt committed Oct 7, 2021
1 parent c5c3646 commit 58dea12
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions spec/asynciterable/inference-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<number, number>());
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<number, number>(), {
preventClose: false,
});
expect(source).toEqualStream([0, 1, 2]);
Expand Down
4 changes: 2 additions & 2 deletions spec/iterable/inference-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<number, number>());
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<number, number>(), {
preventClose: false,
});
expect(source).toEqualStream([0, 1, 2]);
Expand Down
2 changes: 1 addition & 1 deletion src/asynciterable/todomstream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,6 @@ declare module '../asynciterable/asynciterablex' {
pipeThrough<R extends ReadableStream<any>>(
duplex: { writable: WritableStream<T>; readable: R },
options?: StreamPipeOptions
): ReadableStream<T>;
): R;
}
}
2 changes: 1 addition & 1 deletion src/iterable/todomstream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ declare module '../iterable/iterablex' {
pipeThrough<R extends ReadableStream<any>>(
duplex: { writable: WritableStream<T>; readable: R },
options?: StreamPipeOptions
): ReadableStream<T>;
): R;
}
}

0 comments on commit 58dea12

Please sign in to comment.