From 874113db96320714218a8ad858f4b84cfc9e034f Mon Sep 17 00:00:00 2001 From: GauthierWebDev Date: Tue, 22 Apr 2025 17:00:16 +0200 Subject: [PATCH] style: optimize cachePathname assignment --- app/pages/+data.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/pages/+data.ts b/app/pages/+data.ts index 3472ac3..873d355 100644 --- a/app/pages/+data.ts +++ b/app/pages/+data.ts @@ -22,9 +22,7 @@ export async function data(pageContext: PageContext) { }); let cachePathname = urlParsed.pathname.replace(/\/$/, "").replace(/^\//, ""); - if (cachePathname === "") { - cachePathname = "index"; - } + if (cachePathname === "") cachePathname = "index"; const doc = docCache.get(cachePathname); @@ -41,7 +39,7 @@ export async function data(pageContext: PageContext) { docs: docCache.orderByLastEdit({ limit: 2, includedBasePaths: ["docs", "certifications"], - excludedFileNames: [cachePathname], + excludedFileNames: [cachePathname, "docs", "certifications"], }), }; }