0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

chore(ext/fetch): render jsdoc code example properly (#13656)

This commit is contained in:
Geert-Jan Zwiers 2022-02-12 16:15:54 +01:00 committed by GitHub
parent 65de5fb465
commit 911ddbc733
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -424,13 +424,15 @@ declare class Response implements Body {
text(): Promise<string>;
}
/** Fetch a resource from the network. It returns a Promise that resolves to the
* Response to that request, whether it is successful or not.
/** Fetch a resource from the network. It returns a `Promise` that resolves to the
* `Response` to that `Request`, whether it is successful or not.
*
* const response = await fetch("http://my.json.host/data.json");
* console.log(response.status); // e.g. 200
* console.log(response.statusText); // e.g. "OK"
* const jsonData = await response.json();
* ```ts
* const response = await fetch("http://my.json.host/data.json");
* console.log(response.status); // e.g. 200
* console.log(response.statusText); // e.g. "OK"
* const jsonData = await response.json();
* ```
*/
declare function fetch(
input: Request | URL | string,