Skip to content

Commit

Permalink
Disable reviveNumbers on XML parser to preserver zero-leading numbers…
Browse files Browse the repository at this point in the history
… (e.g. 0001 -> 1) and floats that end in .0 e.g. (1.0 -> 1)
  • Loading branch information
Jacob Clarke committed Feb 13, 2024
1 parent ad53f7f commit ca477d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fileHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export function parseToscXML({ xmlString, fileSize }: { xmlString: string; fileS
const total = fileSize || new Blob([xmlString]).size
const progress = new ProgressBar({ total, display: ':percent [:bar] :time' })
try {
const json = parseXml(xmlString, { progress: (bytes) => progress.render(bytes) }) as unknown as ToscDoc
const json = parseXml(xmlString, {
reviveNumbers: false,
progress: (bytes) => progress.render(bytes),
}) as unknown as ToscDoc
progress.render(total)
console.log(`✅ XML successfully parsed (took ${stopwatchTick()} ms)`)
return json
Expand Down

0 comments on commit ca477d1

Please sign in to comment.