item.categories are not optional
Open
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 128
- PR merge metrics
- No merged PRs in 30d
Description
My feed items do not have categories, and the docs list this as optional.
When running `feed.xml()`:
```
TypeError: undefined is not an object (evaluating 'item.categories.forEach')
at /node_modules/rss/lib/index.js:71:9
at forEach (:1:21)
at generateXML (/node_modules/rss/lib/index.js:63:5)
at /node_modules/rss/lib/index.js:185:17
```
When I change `node_modules/rss/lib/index.js:71` to:
```js
item.categories?.forEach(function(category) {
ifTruePush(category, item_values, { category: { _cdata: category } });
});
```
I am able to generate the xml feed
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.