Skip to content

Commit e68945b

Browse files
chowsonchris-howson-metagenicsactions-user
authored
fix(parser): ensure sitemap & url are arrays (#158)
* fix(parser): ensure sitemap & url are arrays * 3.2.20 --------- Co-authored-by: chris-howson-metagenics <chrishowson@metagenics.com> Co-authored-by: GitHub Action <action@github.com>
1 parent af2d0dd commit e68945b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sitemapper",
3-
"version": "3.2.19",
3+
"version": "3.2.20",
44
"description": "Parser for XML Sitemaps to be used with Robots.txt and web crawlers",
55
"keywords": [
66
"parse",

src/assets/sitemapper.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ export default class Sitemapper {
220220
}
221221

222222
// Parse XML using fast-xml-parser
223-
const parser = new XMLParser();
223+
const parser = new XMLParser({
224+
isArray: (tagName) =>
225+
['sitemap', 'url'].some((value) => value === tagName),
226+
});
224227

225228
const data = parser.parse(responseBody.toString());
226229

0 commit comments

Comments
 (0)