mdedetrich / scalajson

ScalaJSON - JSON for Scala, currently contains minimal AST
BSD 3-Clause "New" or "Revised" License
55 stars 10 forks source link

No way to efficiently and safely construct a JNumber from String #22

Closed Ichoran closed 7 years ago

Ichoran commented 7 years ago

In order to avoid an exception, you have to use the regex twice, once before calling the constructor and once in the constructor just to be sure (the constructor calls it for you). It would be better if there were some way to only call the regex once and get an Option[JNumber] out.

mdedetrich commented 7 years ago

This will be done in a new PR since it breaks source compatibility