Skip to content

Commit ec1d331

Browse files
authored
Revert "feat(fetch/network): add generic to json method" (#34098)
1 parent edd7897 commit ec1d331

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/playwright-core/src/client/fetch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ export class APIResponse implements api.APIResponse {
350350
return content.toString('utf8');
351351
}
352352

353-
async json<T = object>(): Promise<T> {
353+
async json(): Promise<object> {
354354
const content = await this.text();
355-
return JSON.parse(content) as T;
355+
return JSON.parse(content);
356356
}
357357

358358
async [Symbol.asyncDispose]() {

packages/playwright-core/src/client/network.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,9 +718,9 @@ export class Response extends ChannelOwner<channels.ResponseChannel> implements
718718
return content.toString('utf8');
719719
}
720720

721-
async json<T = object>(): Promise<T> {
721+
async json(): Promise<object> {
722722
const content = await this.text();
723-
return JSON.parse(content) as T;
723+
return JSON.parse(content);
724724
}
725725

726726
request(): Request {

0 commit comments

Comments
 (0)