Skip to content

Commit

Permalink
chore: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Oct 15, 2024
1 parent 768075d commit 1bd4a38
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/node-utils/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
*keys(): HeadersIterator<string> {
const keys = Object.keys(this[kNodeReq].headers);
for (const key of keys) {
yield key;
}
}

*values(): IterableIterator<string> {
*values(): HeadersIterator<string> {
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]();
}

Expand Down Expand Up @@ -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<string> {
*keys(): HeadersIterator<string> {
const keys = this[kNodeRes].getHeaderNames();
for (const key of keys) {
yield key;
}
}

*values(): IterableIterator<string> {
*values(): HeadersIterator<string> {
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]();
}

Expand Down

0 comments on commit 1bd4a38

Please sign in to comment.