dirty-json
dirty-json copied to clipboard
Remove leading zeros
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.
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.