danieltrost / json-sort

Atom.io Package to sort JSON
1 stars 0 forks source link

Sorting JSON changes values of ints #6

Open gastrodon opened 4 years ago

gastrodon commented 4 years ago

Hello,

Given the following json

{
    "adminIdList": [1313962888790700032]
}

If I highlight this and use the command pallete in atom to sort the data, I'll get back the following

{
    "adminIdList": [
        1313962888790700000
    ]
}

Upon further inspection, this number is 61 bits wide, but JS can only handle 53 bit integers per this

Might it be possible to load all integer keys as strings? This should preserve sorting order, while allowing large numbers to be represented