Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uuid parsing broken in 4.x due to npm published strnum version 1.1.0 #722

Closed
koenfaro90 opened this issue Feb 20, 2025 · 2 comments
Closed

Comments

@koenfaro90
Copy link

Posting this here too as this is where people will likely experience the issue; strnum has published a backwards-incompatible change in 1.1.0 from 1.0.5 - see issue NaturalIntelligence/strnum#11. This causes new installations of the 4.x branch to fail parsing UUID-like strings.

import { XMLParser } from 'fast-xml-parser';

const xml = `
<?xml version="1.0" encoding="UTF-8"?>' +
<Id1>0e406434-49ea-46fd-a01a-2e4ddd76e91c</Id1>
<Id2>e406434-49ea-46fd-a01a-2e4ddd76e91c</Id2>
<Id3>1e406434-49ea-46fd-a01a-2e4ddd76e91c</Id3>
<Id4>0f406434-49ea-46fd-a01a-2e4ddd76e91c</Id4>
`
const parser = new XMLParser();
const result = parser.parse(xml);
console.log('result', result);

Result will be

result {
  '?xml': '',
  Id1: NaN,
  Id2: NaN,
  Id3: Infinity,
  Id4: '0f406434-49ea-46fd-a01a-2e4ddd76e91c'
}
Copy link

We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo.

@amitguptagwl
Copy link
Member

release a previous minor version with fix. let me know what other issues you're facing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants