Revert "feat(fetch/network): add generic to json method (#34091)"

This reverts commit 94ffbcb9c5.
This commit is contained in:
Pavel Feldman 2024-12-19 11:44:22 -08:00 committed by GitHub
parent 94ffbcb9c5
commit 482dbcd5c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -350,9 +350,9 @@ export class APIResponse implements api.APIResponse {
return content.toString('utf8'); return content.toString('utf8');
} }
async json<T = object>(): Promise<T> { async json(): Promise<object> {
const content = await this.text(); const content = await this.text();
return JSON.parse(content) as T; return JSON.parse(content);
} }
async [Symbol.asyncDispose]() { async [Symbol.asyncDispose]() {

View file

@ -718,9 +718,9 @@ export class Response extends ChannelOwner<channels.ResponseChannel> implements
return content.toString('utf8'); return content.toString('utf8');
} }
async json<T = object>(): Promise<T> { async json(): Promise<object> {
const content = await this.text(); const content = await this.text();
return JSON.parse(content) as T; return JSON.parse(content);
} }
request(): Request { request(): Request {