mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
Revert "feat(fetch/network): add generic to json method" (#34098)
This commit is contained in:
parent
edd789780a
commit
ec1d3313c3
@ -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]() {
|
||||||
|
|||||||
@ -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 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user