From 1bd4a3809301c3d9bd6b4c48a50f1e8715efa372 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 15 Oct 2024 17:55:59 +0800 Subject: [PATCH] chore: fix types --- src/node-utils/headers.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/node-utils/headers.ts b/src/node-utils/headers.ts index 0f8939d..f65f38d 100644 --- a/src/node-utils/headers.ts +++ b/src/node-utils/headers.ts @@ -77,28 +77,28 @@ export const NodeReqHeadersProxy = /* @__PURE__ */ (() => } } - *entries(): IterableIterator<[string, string]> { + *entries(): HeadersIterator<[string, string]> { const _headers = this[kNodeReq].headers; for (const key in _headers) { yield [key, _normalizeValue(_headers[key])]; } } - *keys(): IterableIterator { + *keys(): HeadersIterator { const keys = Object.keys(this[kNodeReq].headers); for (const key of keys) { yield key; } } - *values(): IterableIterator { + *values(): HeadersIterator { const values = Object.values(this[kNodeReq].headers); for (const value of values) { yield _normalizeValue(value); } } - [Symbol.iterator](): IterableIterator<[string, string]> { + [Symbol.iterator](): HeadersIterator<[string, string]> { return this.entries()[Symbol.iterator](); } @@ -164,28 +164,28 @@ export const NodeResHeadersProxy = /* @__PURE__ */ (() => } } - *entries(): IterableIterator<[string, string]> { + *entries(): HeadersIterator<[string, string]> { const _headers = this[kNodeRes].getHeaders(); for (const key in _headers) { yield [key, _normalizeValue(_headers[key])]; } } - *keys(): IterableIterator { + *keys(): HeadersIterator { const keys = this[kNodeRes].getHeaderNames(); for (const key of keys) { yield key; } } - *values(): IterableIterator { + *values(): HeadersIterator { const values = Object.values(this[kNodeRes].getHeaders()); for (const value of values) { yield _normalizeValue(value); } } - [Symbol.iterator](): IterableIterator<[string, string]> { + [Symbol.iterator](): HeadersIterator<[string, string]> { return this.entries()[Symbol.iterator](); }