Skip to content

Commit

Permalink
Add handling of single entry atom feed
Browse files Browse the repository at this point in the history
  • Loading branch information
villasv committed Jan 31, 2025
1 parent a684eb0 commit 8081856
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/generate-rss.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ async function fetchFeed(url) {
parsedData?.feed?.entry || // Atom format
[];

return items.map(extractItemData);
// if feed contains a single entry, it might return as object instead of array
if (!Array.isArray(items)) return [items].map(extractItemData);
else return items.map(extractItemData);
}

async function generateMergedRSS() {
Expand Down

0 comments on commit 8081856

Please sign in to comment.