Skip to content

Commit

Permalink
fix: xml resources is now always an array
Browse files Browse the repository at this point in the history
  • Loading branch information
crashmax-dev committed Nov 23, 2023
1 parent ef6443b commit f2b9e6e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/xml-locales/src/xml-locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ export class XmlLocales {
}

if (xmlData) {
this.xmlData = this.xmlParser.xmlToJson(xmlData);
const parsedXml = this.xmlParser.xmlToJson(xmlData);
if (Array.isArray(parsedXml.resources.string)) {
this.xmlData = parsedXml;
} else {
this.xmlData = new XmlJsonData({
resources: { string: [parsedXml.resources.string] }
});
}
return;
}

Expand Down

0 comments on commit f2b9e6e

Please sign in to comment.