mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
Clean up in fetch.ts
This commit is contained in:
parent
4e55928063
commit
c21ae406af
1 changed files with 2 additions and 13 deletions
15
fetch.ts
15
fetch.ts
|
@ -55,9 +55,8 @@ class FetchResponse implements Response {
|
|||
|
||||
async text(): Promise<string> {
|
||||
const ab = await this.arrayBuffer();
|
||||
const enc = new TextDecoder("utf-8");
|
||||
// Maybe new Uint8Array(ab)
|
||||
return enc.decode(ab);
|
||||
const decoder = new TextDecoder("utf-8");
|
||||
return decoder.decode(ab);
|
||||
}
|
||||
|
||||
get ok(): boolean {
|
||||
|
@ -139,13 +138,3 @@ export function fetch(
|
|||
fetchReq.start();
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
fetch('http://example.com/movies.json')
|
||||
.then(function(response) {
|
||||
return response.json();
|
||||
})
|
||||
.then(function(myJson) {
|
||||
console.log(myJson);
|
||||
});
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue