ungap / raw-json

JSON.rawJSON and isRawJSON ponyfill
MIT License
24 stars 0 forks source link

scientific notation with positive exponent e.g. 1e+21 #7

Closed lameuler closed 4 days ago

lameuler commented 4 days ago

From what I can see the current regex [0-9eE.-]+ does not account for numbers in scientific notation with a + at the front of the exponent.

So for example 1e+21 gets replaced to "1e"+"21" instead of "1e+21" which causes syntax errors when parsing. I think just adding + to the regex character class should fix this?

WebReflection commented 4 days ago

Fixed, thanks!