nasa8x / rss-to-json

RSS and Atom feed generator for Node.js
https://morioh.com/@5df445b0103f3007600e1a57
177 stars 77 forks source link

entry and items might not exist, default to an empty array #39

Closed JaredAAT closed 2 years ago

JaredAAT commented 2 years ago

This fixes: https://github.com/nasa8x/rss-to-json/issues/38 by defaulting the entry/item expected on channel to be an empty array if entry or item does not exist on channel as seen in an RSS feed like:

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title><![CDATA[Amazon API Gateway (London) Service Status]]></title>
    <link>http://status.aws.amazon.com/</link>
    <language>en-us</language>
    <lastBuildDate>Fri, 17 Dec 2021 00:05:40 PST</lastBuildDate>
    <generator>AWS Service Health Dashboard RSS Generator</generator>
    <description><![CDATA[Amazon API Gateway (London) Service Status]]></description>
    <ttl>5</ttl>
    <!-- You seem to care about knowing about your events, why not check out https://docs.aws.amazon.com/health/latest/ug/getting-started-api.html -->

  </channel>
</rss>