Skip to content

Commit

Permalink
fix(parser): ensure sitemap & url are arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-howson-metagenics committed Nov 11, 2024
1 parent af2d0dd commit af09988
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/assets/sitemapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ export default class Sitemapper {
}

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

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

Expand Down

0 comments on commit af09988

Please sign in to comment.