From af099880e511bf0dc63518e4ffe11f0d29cb3b5e Mon Sep 17 00:00:00 2001 From: chris-howson-metagenics Date: Mon, 11 Nov 2024 11:01:54 +0000 Subject: [PATCH] fix(parser): ensure sitemap & url are arrays --- src/assets/sitemapper.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/assets/sitemapper.js b/src/assets/sitemapper.js index 1b1abc6..b415ec4 100644 --- a/src/assets/sitemapper.js +++ b/src/assets/sitemapper.js @@ -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());