fix: disable stripping on XML parsing

This commit is contained in:
Menci
2026-01-24 05:24:56 +08:00
parent f14d4264b1
commit 1ac63eb4da
+1 -1
View File
@@ -7,7 +7,7 @@ export async function* parseXmls(stream: ReturnType<typeof glob.stream>) {
for await (const file of stream) { for await (const file of stream) {
const fileName = typeof file === 'string' ? file : file.fullpath(); const fileName = typeof file === 'string' ? file : file.fullpath();
const xmlString = await fs.promises.readFile(fileName, 'utf-8'); const xmlString = await fs.promises.readFile(fileName, 'utf-8');
const xml = new XMLParser({ ignoreAttributes: false, allowBooleanAttributes: true }).parse(xmlString); const xml = new XMLParser({ ignoreAttributes: false, allowBooleanAttributes: true, trimValues: false }).parse(xmlString);
yield { fileName, xml }; yield { fileName, xml };
} }
} }