Skip to content

Commit 168518f

Browse files
committed
docs: fixed typos in Fetch jsdocs (#4355)
1 parent e9fac92 commit 168518f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src.ts/utils/fetch.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/**
22
* Fetching content from the web is environment-specific, so Ethers
3-
* provides an abstraction the each environment can implement to provide
3+
* provides an abstraction that each environment can implement to provide
44
* this service.
55
*
66
* On [Node.js](link-node), the ``http`` and ``https`` libs are used to
77
* create a request object, register event listeners and process data
88
* and populate the [[FetchResponse]].
99
*
1010
* In a browser, the [DOM fetch](link-js-fetch) is used, and the resulting
11-
* ``Promise`` is waited on to retreive the payload.
11+
* ``Promise`` is waited on to retrieve the payload.
1212
*
1313
* The [[FetchRequest]] is responsible for handling many common situations,
14-
* such as redirects, server throttling, authentcation, etc.
14+
* such as redirects, server throttling, authentication, etc.
1515
*
1616
* It also handles common gateways, such as IPFS and data URIs.
1717
*
@@ -26,7 +26,7 @@ import { toUtf8Bytes, toUtf8String } from "./utf8.js"
2626
import { createGetUrl } from "./geturl.js";
2727

2828
/**
29-
* An environments implementation of ``getUrl`` must return this type.
29+
* An environment's implementation of ``getUrl`` must return this type.
3030
*/
3131
export type GetUrlResponse = {
3232
statusCode: number,
@@ -204,7 +204,7 @@ export class FetchRequest implements Iterable<[ key: string, value: string ]> {
204204
#getUrlFunc: null | FetchGetUrlFunc;
205205

206206
/**
207-
* The fetch URI to requrest.
207+
* The fetch URL to request.
208208
*/
209209
get url(): string { return this.#url; }
210210
set url(url: string) {
@@ -219,15 +219,15 @@ export class FetchRequest implements Iterable<[ key: string, value: string ]> {
219219
* header.
220220
*
221221
* If %%body%% is null, the body is cleared (along with the
222-
* intrinsic ``Content-Type``) and the .
222+
* intrinsic ``Content-Type``).
223223
*
224-
* If %%body%% is a string, the intrincis ``Content-Type`` is set to
224+
* If %%body%% is a string, the intrinsic ``Content-Type`` is set to
225225
* ``text/plain``.
226226
*
227-
* If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to
227+
* If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to
228228
* ``application/octet-stream``.
229229
*
230-
* If %%body%% is any other object, the intrincis ``Content-Type`` is
230+
* If %%body%% is any other object, the intrinsic ``Content-Type`` is
231231
* set to ``application/json``.
232232
*/
233233
get body(): null | Uint8Array {
@@ -278,7 +278,7 @@ export class FetchRequest implements Iterable<[ key: string, value: string ]> {
278278
* The headers that will be used when requesting the URI. All
279279
* keys are lower-case.
280280
*
281-
* This object is a copy, so any chnages will **NOT** be reflected
281+
* This object is a copy, so any changes will **NOT** be reflected
282282
* in the ``FetchRequest``.
283283
*
284284
* To set a header entry, use the ``setHeader`` method.
@@ -381,7 +381,7 @@ export class FetchRequest implements Iterable<[ key: string, value: string ]> {
381381
}
382382

383383
/**
384-
* The timeout (in milliseconds) to wait for a complere response.
384+
* The timeout (in milliseconds) to wait for a complete response.
385385
* //(default: 5 minutes)//
386386
*/
387387
get timeout(): number { return this.#timeout; }
@@ -610,7 +610,7 @@ export class FetchRequest implements Iterable<[ key: string, value: string ]> {
610610
* to %%location%%.
611611
*/
612612
redirect(location: string): FetchRequest {
613-
// Redirection; for now we only support absolute locataions
613+
// Redirection; for now we only support absolute locations
614614
const current = this.url.split(":")[0].toLowerCase();
615615
const target = location.split(":")[0].toLowerCase();
616616

@@ -764,7 +764,7 @@ interface ThrottleError extends Error {
764764
};
765765

766766
/**
767-
* The response for a FetchREquest.
767+
* The response for a FetchRequest.
768768
*/
769769
export class FetchResponse implements Iterable<[ key: string, value: string ]> {
770770
#statusCode: number;
@@ -909,7 +909,7 @@ export class FetchResponse implements Iterable<[ key: string, value: string ]> {
909909
}
910910

911911
/**
912-
* Returns true of the response has a body.
912+
* Returns true if the response has a body.
913913
*/
914914
hasBody(): this is (FetchResponse & { body: Uint8Array }) {
915915
return (this.#body != null);

0 commit comments

Comments
 (0)