Skip to content

Commit 15a1467

Browse files
001ProMaxVirgilClyne
authored andcommitted
fix: type error
1 parent 8e2b72e commit 15a1467

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/process/response.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export async function Response($request, $response) {
6565
break;
6666
case "text/json":
6767
case "application/json":
68-
body = $app === "Node.js" ? new TextDecoder().decode($response.body ?? new Uint8Array()) : JSON.parse($response.body ?? "{}");
68+
body = JSON.parse($app === "Node.js" ? new TextDecoder().decode($response.body ?? new Uint8Array()) : ($response.body ?? "{}"));
6969
switch (url.hostname) {
7070
case "weatherkit.apple.com":
7171
// 路径判断

src/process/response.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export async function Response($request, $response) {
5454
break;
5555
case "text/json":
5656
case "application/json":
57-
body = $app === "Node.js" ? new TextDecoder().decode($response.body ?? new Uint8Array()) : JSON.parse($response.body ?? "{}");
57+
body = JSON.parse($app === "Node.js" ? new TextDecoder().decode($response.body ?? new Uint8Array()) : ($response.body ?? "{}"));
5858
switch (url.hostname) {
5959
case "weatherkit.apple.com":
6060
// 路径判断

0 commit comments

Comments
 (0)