When parseNumbers is called with a boolean value, it will return NaN. When parseNumbers is called with any other string it will return that string. For example
parseNumbers("true") // returns "true"
parseNumbers(true) // returns NaN
The workaround is to make sure that parseNumbers is defined first in the array of attrValueProcessors. Coding changes could also be made. At a minimum, I recommend that the documentation here is updated:
Given a custom parser, the order of the attrValueProcessors impacts the results in a way that I found odd as a consumer of this library.
yields different results than:
The reason why can be found looking at the code: https://github.com/Leonidas-from-XIV/node-xml2js/blob/master/lib/processors.js#L20
When parseNumbers is called with a boolean value, it will return NaN. When parseNumbers is called with any other string it will return that string. For example
The workaround is to make sure that parseNumbers is defined first in the array of attrValueProcessors. Coding changes could also be made. At a minimum, I recommend that the documentation here is updated:
https://github.com/Leonidas-from-XIV/node-xml2js#processing-attribute-tag-names-and-values