From 9b85bb2ca4a59c787c4feb25915449b1e9f397ab Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Tue, 30 Jun 2026 04:03:54 +0000 Subject: [PATCH] fix: apply Biome formatting to docs-proxy (remove semicolons) The project uses no-semicolons style per Biome configuration. Co-Authored-By: Claude Opus 4.5 --- apps/docs-proxy/src/index.ts | 43 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/apps/docs-proxy/src/index.ts b/apps/docs-proxy/src/index.ts index 3aae0fa2..6b910bc1 100644 --- a/apps/docs-proxy/src/index.ts +++ b/apps/docs-proxy/src/index.ts @@ -1,33 +1,36 @@ -const UPSTREAM_BASE = "https://supermemory.mintlify.dev"; -const CACHE_TTL = 300; // 5 minutes -const FETCH_TIMEOUT_MS = 10000; // 10 seconds +const UPSTREAM_BASE = "https://supermemory.mintlify.dev" +const CACHE_TTL = 300 // 5 minutes +const FETCH_TIMEOUT_MS = 10000 // 10 seconds export default { async fetch(request: Request): Promise { - const url = new URL(request.url); - const proxyUrl = UPSTREAM_BASE + url.pathname + url.search; + const url = new URL(request.url) + const proxyUrl = UPSTREAM_BASE + url.pathname + url.search - const cache = caches.default; + const cache = caches.default if (request.method === "GET") { - const cached = await cache.match(request); - if (cached) return cached; + const cached = await cache.match(request) + if (cached) return cached } - const controller = new AbortController(); - const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS); + const controller = new AbortController() + const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS) try { - const proxyRequest = new Request(proxyUrl, request); - const response = await fetch(proxyRequest, { signal: controller.signal }); + const proxyRequest = new Request(proxyUrl, request) + const response = await fetch(proxyRequest, { signal: controller.signal }) if (request.method === "GET" && response.ok) { - const cachedResponse = new Response(response.clone().body, response); - cachedResponse.headers.set("Cache-Control", `public, max-age=${CACHE_TTL}`); - await cache.put(request, cachedResponse); + const cachedResponse = new Response(response.clone().body, response) + cachedResponse.headers.set( + "Cache-Control", + `public, max-age=${CACHE_TTL}`, + ) + await cache.put(request, cachedResponse) } - return response; + return response } catch (e) { if (e instanceof Error && e.name === "AbortError") { return new Response( @@ -36,11 +39,11 @@ export default { status: 504, headers: { "Content-Type": "text/plain; charset=utf-8" }, }, - ); + ) } - throw e; + throw e } finally { - clearTimeout(timeoutId); + clearTimeout(timeoutId) } }, -}; +}