From 19a63070ed4f44d02e8505af59ecd8a777f1292d Mon Sep 17 00:00:00 2001 From: 7w1 Date: Thu, 2 Apr 2026 16:18:02 -0500 Subject: [PATCH] formatting --- src/app/theme/catalog.ts | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/app/theme/catalog.ts b/src/app/theme/catalog.ts index 739dbd09d..a848f9774 100644 --- a/src/app/theme/catalog.ts +++ b/src/app/theme/catalog.ts @@ -46,25 +46,23 @@ async function fetchThemePairsFromManifest(manifestUrl: string): Promise; - const basename = o.basename; - const previewUrl = o.previewUrl; - const fullUrl = o.fullUrl; - if ( - typeof basename !== 'string' || - typeof previewUrl !== 'string' || - typeof fullUrl !== 'string' - ) { - continue; - } - if (!basename || !previewUrl || !fullUrl) continue; - pairs.push({ basename, previewUrl, fullUrl }); - } + const pairs: ThemePair[] = themes + .map((row) => { + if (!row || typeof row !== 'object') return null; + const { basename, previewUrl, fullUrl } = row as Record; + if ( + typeof basename !== 'string' || + typeof previewUrl !== 'string' || + typeof fullUrl !== 'string' + ) { + return null; + } + if (!basename || !previewUrl || !fullUrl) return null; + return { basename, previewUrl, fullUrl }; + }) + .filter((pair): pair is ThemePair => pair !== null); return pairs; }