From cc3ca26de47e862a181c476daddb63e01f92f9a4 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Sat, 8 Oct 2016 19:54:59 +0200 Subject: [PATCH] Fix wrong stream TransformOptions interface. (#11849) Transform streams are duplex streams and extend the latter's constructor options. --- node/node-tests.ts | 7 +++++-- node/node.d.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/node/node-tests.ts b/node/node-tests.ts index 433435ee13..8f04a2ddf9 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -487,7 +487,10 @@ function simplified_stream_ctor_test() { chunks[0].chunk.slice(0); chunks[0].encoding.charAt(0); cb(); - } + }, + allowHalfOpen: true, + readableObjectMode: true, + writableObjectMode: true }) } @@ -747,7 +750,7 @@ namespace tls_tests { let _response: Buffer = response; }) _TLSSocket = _TLSSocket.prependOnceListener("secureConnect", () => { }); - } + } } //////////////////////////////////////////////////// diff --git a/node/node.d.ts b/node/node.d.ts index 47daf29384..0b91d8095c 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -3276,7 +3276,7 @@ declare module "stream" { end(chunk: any, encoding?: string, cb?: Function): void; } - export interface TransformOptions extends ReadableOptions, WritableOptions { + export interface TransformOptions extends DuplexOptions { transform?: (chunk: string | Buffer, encoding: string, callback: Function) => any; flush?: (callback: Function) => any; }