From 1a16c23ced22421527bae2fb3fa6a9832f886692 Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 7 Jan 2025 15:56:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0response=E5=8E=9F=E7=94=9F?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.d.ts | 4 +++- index.js | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 59922bc..8b79a15 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,9 +1,11 @@ import { IncomingMessage, ServerResponse } from 'http' export default class Response { + constructor(req: IncomingMessage, res: ServerResponse) + status: number - constructor(req: IncomingMessage, res: ServerResponse) + get response(): ServerResponse get ended(): boolean diff --git a/index.js b/index.js index 9232a59..cc6cb04 100644 --- a/index.js +++ b/index.js @@ -24,6 +24,10 @@ export default class Response { this.#ended = !!res.ended } + get response() { + return this.#res + } + get ended() { return this.#ended }