richie5um / vscode-sort-json

VSCode Extension to Sort JSON objects
https://marketplace.visualstudio.com/items?itemName=richie5um2.vscode-sort-json
MIT License
110 stars 19 forks source link

not handle int64 correctly #54

Open kjkszpj opened 3 years ago

kjkszpj commented 3 years ago

how to reproduce:

  1. write a json with int64 value
  2. sort the json
  3. seethe int64 value change

i guess it is about the accuracy problem in js

Shapedsundew9 commented 2 years ago

+1 Max signed 64 bit int: 2**63-1 == 9223372036854775807 If 9223372036854775807 is in the JSON file and then sorted it gets silently changed to 9223372036854776000 which would overflow.

A work around if you do not care about the full range is to use 9223372036854775000 which does not get modified.