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

This commit is contained in:
Pavel Feldman 2024-12-19 12:46:39 -08:00 committed by GitHub
parent edd789780a
commit ec1d3313c3
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 {