From 3197ade4c028fa0840fd10eea1952588bb145776 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 19 Nov 2021 16:00:42 +0000 Subject: [PATCH 1/2] fix: return request after setting header --- src/runtime/node/http/response.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/node/http/response.ts b/src/runtime/node/http/response.ts index f61bea5b..cd111a6c 100644 --- a/src/runtime/node/http/response.ts +++ b/src/runtime/node/http/response.ts @@ -79,8 +79,9 @@ export class ServerResponse extends Writable implements http.ServerResponse { return this } - setHeader (name: string, value: number | string | ReadonlyArray): void { + setHeader (name: string, value: number | string | ReadonlyArray): this { this._headers[name.toLowerCase()] = value + '' + return this } getHeader (name: string): number | string | string[] | undefined { From edd42052c697f35ed62b4421e05d5376da2c6ca3 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 1 Dec 2021 16:35:57 +0000 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20return=20`this`=20as=20void=20?= =?UTF-8?q?=F0=9F=98=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * pending upstream PR --- src/runtime/node/stream/writable.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/node/stream/writable.ts b/src/runtime/node/stream/writable.ts index 46516705..deaca3f8 100644 --- a/src/runtime/node/stream/writable.ts +++ b/src/runtime/node/stream/writable.ts @@ -66,6 +66,8 @@ export class Writable extends EventEmitter implements stream.Writable { this.writableFinished = true this.emit('close') this.emit('finish') + // TODO: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57473 + return this as unknown as void } cork (): void { @@ -78,5 +80,7 @@ export class Writable extends EventEmitter implements stream.Writable { this.destroyed = true delete this._data this.removeAllListeners() + // TODO: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57473 + return this as unknown as void } }