From c437b8adb195343b21f195c65f81ff88704ecc89 Mon Sep 17 00:00:00 2001 From: "brobert (aider)" Date: Tue, 1 Apr 2025 14:59:13 +0200 Subject: [PATCH] fix: correct post processing filter logic --- scrape-blog.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scrape-blog.ts b/scrape-blog.ts index 0a98dca..68187bc 100644 --- a/scrape-blog.ts +++ b/scrape-blog.ts @@ -96,11 +96,7 @@ async function fetchBlogPosts(): Promise { results.push(await processPost(url)); } - const posts: BlogPost[] = results - .filter((result): result is PromiseFulfilledResult => - result.status === 'fulfilled' && result.value !== null - ) - .map(result => result.value); + const posts: BlogPost[] = results.filter((post): post is BlogPost => post !== null); console.log(`Successfully processed ${posts.length}/${postUrls.length} posts`); return posts;