dirty-json icon indicating copy to clipboard operation
dirty-json copied to clipboard

Remove leading zeros

Open Erkin97-zz opened this issue 5 years ago • 1 comments

Hi, when you have an unquoted string with leading zeros it removes zeros.

{ "id": 00000111 } -> { "id": 111 } or { "id": A00000111 } -> { "id": "A111" }

I think it's related to Number conversion, but not sure.

Erkin97-zz avatar Jun 12 '20 03:06 Erkin97-zz

Huh, that's a weird one! I think the "right" behavior in the first case would either be to treat the number as octal (like in JS) or to do what the parser currently does. In the second case, I would expect

{"id": "A00000111"}

I'll take a look at this soon.

RyanMarcus avatar Jun 12 '20 14:06 RyanMarcus