NaturalIntelligence / fast-xml-parser

Validate XML, Parse XML and Build XML rapidly without C/C++ based libraries and no callback.
https://naturalintelligence.github.io/fast-xml-parser/
MIT License
2.45k stars 296 forks source link

IsArray option isn't parsing tags with 0 as value correctly #490 #557

Closed omggga closed 1 year ago

omggga commented 1 year ago

Purpose / Goal

This is fix for isArray option isn't parsing tags with 0 as value correctly. This only affected when we are parsing tags, not attributes.

The problem is that obj[options.textNodeName] is checking the value exist, but if it false or 0 it will fail the test. So you can try to fix it to test it also for boolean type or zero.

The opened issue is #490

Type

Please mention the type of PR

coveralls commented 1 year ago

Coverage Status

Coverage: 98.16% (+0.003%) from 98.156% when pulling 90021b4efc4e93f1c850b2726f137e2a77180b91 on omggga:patch-leaftag into 292fb784334043214e29fa60adbb5630a36f5768 on NaturalIntelligence:master.

amitguptagwl commented 1 year ago

Can you please add a test for the same?

omggga commented 1 year ago

Can you please add a test for the same?

I added a test to check this feature.