refactor(ext/fetch): simplify fetch ops (#19494)

Addresses feedback from
https://github.com/denoland/deno/pull/19412#discussion_r1227912676
This commit is contained in:
Bartek Iwańczuk 2023-06-15 15:34:21 +02:00 committed by GitHub
parent 3d71c36888
commit f145cbfacc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 63 additions and 81 deletions

View file

@ -228,7 +228,7 @@ function prettyResourceNames(name) {
return ["A fetch request", "started", "finished"];
case "fetchRequestBody":
return ["A fetch request body", "created", "closed"];
case "fetchResponseBody":
case "fetchResponse":
return ["A fetch response body", "created", "consumed"];
case "httpClient":
return ["An HTTP client", "created", "closed"];
@ -295,7 +295,7 @@ function resourceCloseHint(name) {
return "Await the promise returned from `fetch()` or abort the fetch with an abort signal.";
case "fetchRequestBody":
return "Terminate the request body `ReadableStream` by closing or erroring it.";
case "fetchResponseBody":
case "fetchResponse":
return "Consume or close the response body `ReadableStream`, e.g `await resp.text()` or `await resp.body.cancel()`.";
case "httpClient":
return "Close the HTTP client by calling `httpClient.close()`.";