From 3e2ab53400ae154a2bfed4c40ff4a94135feb0f4 Mon Sep 17 00:00:00 2001 From: soruly Date: Sat, 8 Jul 2023 18:47:08 +0000 Subject: [PATCH] Apply prettier format --- components/info.js | 4 ++-- image-proxy.js | 4 ++-- pages/about.js | 10 +++++----- pages/index.js | 8 ++++---- public/sw.js | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/components/info.js b/components/info.js index 2de7e17..d3d4a88 100644 --- a/components/info.js +++ b/components/info.js @@ -59,8 +59,8 @@ export default function Layout({ anilist: src }) { ...(src.synonyms_chinese || []), ] .filter((e) => e) - .filter((e) => e !== src.title.native || e !== src.title.romaji) - ) + .filter((e) => e !== src.title.native || e !== src.title.romaji), + ), ) .sort() .map((title, i) => { diff --git a/image-proxy.js b/image-proxy.js index 8d601ec..061eb6e 100644 --- a/image-proxy.js +++ b/image-proxy.js @@ -55,7 +55,7 @@ const handleRequest = async (originalRequest) => { referer: imageURL.origin, "User-Agent": "googlebot", }, - }) + }), ); if (response.status === 200) { const ogImageURL = (await webResponse.text()) @@ -69,7 +69,7 @@ const handleRequest = async (originalRequest) => { headers: { referer: imageURL.origin, }, - }) + }), ); if (response.status >= 400) { return new Response(response.body, { diff --git a/pages/about.js b/pages/about.js index 799361f..a04670c 100644 --- a/pages/about.js +++ b/pages/about.js @@ -35,7 +35,7 @@ ChartJS.register( LineElement, Title, Tooltip, - Legend + Legend, ); const getDatabaseStatus = async () => { @@ -62,7 +62,7 @@ const getDatabaseStatus = async () => { const getMediaStatus = async () => { const { mediaCount, mediaFramesTotal, mediaDurationTotal } = await fetch( - `${NEXT_PUBLIC_API_ENDPOINT}/stats?type=media` + `${NEXT_PUBLIC_API_ENDPOINT}/stats?type=media`, ).then((e) => e.json()); return { mediaCount, @@ -441,7 +441,7 @@ const About = () => { Total Duration:{" "} {mediaDurationTotal ? `${Number((mediaDurationTotal / 3600).toFixed(2)).toLocaleString( - navigator.language + navigator.language, )} hours` : "counting..."} @@ -474,7 +474,7 @@ const About = () => { if (!e.target.value.match(/\d+/)) return; setMessage("Searching..."); const status = await fetch( - `${NEXT_PUBLIC_API_ENDPOINT}/status?id=${e.target.value}` + `${NEXT_PUBLIC_API_ENDPOINT}/status?id=${e.target.value}`, ).then((e) => e.json()); setMessage(`Found ${status.length} records`); if (status.length) { @@ -483,7 +483,7 @@ const About = () => { .join("\n"); } else { document.querySelector( - "pre" + "pre", ).innerText = `Cannot find any record for ID ${e.target.value}`; } }} diff --git a/pages/index.js b/pages/index.js index 5c8f410..7ded796 100644 --- a/pages/index.js +++ b/pages/index.js @@ -49,7 +49,7 @@ const Index = () => { setSearchImageSrc( searchParams.get("url").startsWith(location.origin) ? searchParams.get("url") - : `/image-proxy?url=${encodeURIComponent(searchParams.get("url"))}` + : `/image-proxy?url=${encodeURIComponent(searchParams.get("url"))}`, ); } document.addEventListener( @@ -62,7 +62,7 @@ const Index = () => { setSearchImageSrc(URL.createObjectURL(item.getAsFile())); e.preventDefault(); }, - false + false, ); window.onerror = function (message, source, lineno, colno, error) { @@ -124,7 +124,7 @@ const Index = () => { search(blob); }, "image/jpeg", - 0.8 + 0.8, ); }; image.onerror = () => { @@ -177,7 +177,7 @@ const Index = () => { `Searched ${frameCount.toLocaleString(navigator.language)} frames in ${( (performance.now() - startSearchTime) / 1000 - ).toFixed(2)}s` + ).toFixed(2)}s`, ); if (result.length === 0) { diff --git a/public/sw.js b/public/sw.js index 1ee49e5..e555611 100644 --- a/public/sw.js +++ b/public/sw.js @@ -19,7 +19,7 @@ self.addEventListener("fetch", (event) => { } catch (e) { return fetch(req); } - })() + })(), ); } if (