Skip to content

Commit

Permalink
update TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Dec 12, 2024
1 parent d3753d4 commit 1a2d786
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"reflect-metadata": "^0.2.2",
"repl": "^0.1.3",
"tsx": "^4.19.2",
"typescript": "^5.2.2",
"typescript": "^5.7.2",
"uuid": "^11.0.3",
"wasmedge_quickjs": "github:demergent-labs/wasmedge-quickjs#3b3b0ee91248ccf9cd954ffafbac7e024648af92"
},
Expand Down
10 changes: 10 additions & 0 deletions src/lib/experimental/fetch/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ export class AzleFetchResponse {
return (this.body as unknown as Uint8Array | Buffer).buffer;
}

async bytes(): Promise<Uint8Array> {
this.bodyUsed = true;

if (this.body === null) {
return new Uint8Array();
}

return new Uint8Array(this.body as unknown as Uint8Array | Buffer);
}

async json(): Promise<string> {
this.bodyUsed = true;

Expand Down

0 comments on commit 1a2d786

Please sign in to comment.