summaryrefslogtreecommitdiff
path: root/js/fetch.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/fetch.ts')
-rw-r--r--js/fetch.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/js/fetch.ts b/js/fetch.ts
index 2823869ca..355535dfe 100644
--- a/js/fetch.ts
+++ b/js/fetch.ts
@@ -26,7 +26,7 @@ function getHeaderValueParams(value: string): Map<string, string> {
return params;
}
-function hasHeaderValueOf(s: string, value: string) {
+function hasHeaderValueOf(s: string, value: string): boolean {
return new RegExp(`^${value}[\t\s]*;?`).test(s);
}
@@ -204,7 +204,7 @@ class Body implements domTypes.Body, domTypes.ReadableStream, io.ReadCloser {
}
}
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
async json(): Promise<any> {
const text = await this.text();
return JSON.parse(text);
@@ -272,7 +272,7 @@ class Response implements domTypes.Response {
return this.body.formData();
}
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
async json(): Promise<any> {
return this.body.json();
}
@@ -336,6 +336,15 @@ function msgHttpRequest(
return msg.HttpHeader.endHttpHeader(builder);
}
+function deserializeHeaderFields(m: msg.HttpHeader): Array<[string, string]> {
+ const out: Array<[string, string]> = [];
+ for (let i = 0; i < m.fieldsLength(); i++) {
+ const item = m.fields(i)!;
+ out.push([item.key()!, item.value()!]);
+ }
+ return out;
+}
+
/** Fetch a resource from the network. */
export async function fetch(
input: domTypes.Request | string,
@@ -420,12 +429,3 @@ export async function fetch(
const response = new Response(status, headersList, bodyRid);
return response;
}
-
-function deserializeHeaderFields(m: msg.HttpHeader): Array<[string, string]> {
- const out: Array<[string, string]> = [];
- for (let i = 0; i < m.fieldsLength(); i++) {
- const item = m.fields(i)!;
- out.push([item.key()!, item.value()!]);
- }
- return out;
-}