From e4b2dc7a6cff83249f20260b784e474a4d37583c Mon Sep 17 00:00:00 2001 From: Brandon Martel Date: Wed, 14 Sep 2022 06:33:36 -0500 Subject: [PATCH] fix ignore --- .gitignore | 1 + src/ripple/{worker.js => worker.ts} | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) rename src/ripple/{worker.js => worker.ts} (73%) diff --git a/.gitignore b/.gitignore index 3fc0065..8c69afd 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ dist-worker /src/**/*.js /src/**/*.d.ts +!/src/vite-env.d.ts /types # Editor directories and files diff --git a/src/ripple/worker.js b/src/ripple/worker.ts similarity index 73% rename from src/ripple/worker.js rename to src/ripple/worker.ts index f6f3875..03dd9c7 100644 --- a/src/ripple/worker.js +++ b/src/ripple/worker.ts @@ -29,9 +29,16 @@ setInterval(() => { for (const [key, value] of res.headers) { headers[key] = value } - const isJson = headers["content-type"]?.startsWith("application/json") + const isJson = headers['content-type']?.startsWith('application/json') const body = isJson ? await res.json() : await res.text() - return f.onFetch({ headers, ok: res.ok, redirected: res.redirected, status: res.status, statusText: res.statusText, body }) + return f.onFetch({ + headers, + ok: res.ok, + redirected: res.redirected, + status: res.status, + statusText: res.statusText, + body, + }) }) } } @@ -54,9 +61,16 @@ const background = { for (const [key, value] of res.headers) { headers[key] = value } - const isJson = headers["content-type"]?.startsWith("application/json") + const isJson = headers['content-type']?.startsWith('application/json') const body = isJson ? await res.json() : await res.text() - return onFetch({ headers, ok: res.ok, redirected: res.redirected, status: res.status, statusText: res.statusText, body }) + return onFetch({ + headers, + ok: res.ok, + redirected: res.redirected, + status: res.status, + statusText: res.statusText, + body, + }) }) } },