Skip to content

long pure number string exception #3

@bennuXu

Description

@bennuXu

if the xml contains an element with value is a long pure number string,big than MAX_SAFE_INTEGER,
the condition on line 106 "if(rest/1!=rest)" will treats string value as an number, gets a wrong value.

sample:

var xml2json = require('node-xml2json');
var xml = '<a>12548796325845125</a>';
var json = xml2json.parser(xml);
console.log(json); // {a: 12548796325845120}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions