|
|
@ -96,11 +96,7 @@ async function fetchBlogPosts(): Promise<BlogPost[]> {
|
|
|
|
results.push(await processPost(url));
|
|
|
|
results.push(await processPost(url));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const posts: BlogPost[] = results
|
|
|
|
const posts: BlogPost[] = results.filter((post): post is BlogPost => post !== null);
|
|
|
|
.filter((result): result is PromiseFulfilledResult<BlogPost> =>
|
|
|
|
|
|
|
|
result.status === 'fulfilled' && result.value !== null
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
.map(result => result.value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(`Successfully processed ${posts.length}/${postUrls.length} posts`);
|
|
|
|
console.log(`Successfully processed ${posts.length}/${postUrls.length} posts`);
|
|
|
|
return posts;
|
|
|
|
return posts;
|
|
|
|