xml-js
xml-js copied to clipboard
NativeType Conversion Changing Value
Hi,
I am experiencing issue while converting XML to JSON. Where i found that "15932618675018011" (string) was getting converted to 15932618675018012 (number), changing its type and the value as well. Below are the options i had set.
let xml2jsOptions = {
ignoreComment: true,
alwaysChildren: true,
compact: true,
trim: true,
nativeType: true,
nativeTypeAttributes: true,
attributesKey: 'attributes',
textKey: 'value',
ignoreDeclaration: true,
ignoreComment: true,
ignoreCdata: true,
ignoreDoctype: true,
};
TO fix the above issue i changed nativeType: true, => nativeType: false, and it stopped converting values.
Can we have the fix in the library so that it stops behaving this way ?
@lohiaad Please take a note of this issue