summaryrefslogtreecommitdiff
path: root/js/fetch.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2019-03-10 04:30:38 +1100
committerRyan Dahl <ry@tinyclouds.org>2019-03-09 12:30:38 -0500
commit034e2cc02829c9244b32232074c7a48af827a2fb (patch)
treebade01606a1ee076c1f753ce99c97ddb1e4edf30 /js/fetch.ts
parent8c7a12d1b258f0ef5ab27f49c424331d43e8d97f (diff)
Migrate from tslint to eslint for linting (#1905)
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;
-}