libs icon indicating copy to clipboard operation
libs copied to clipboard

reviveNumbers should be disabled by default

Open denizdogan opened this issue 2 years ago • 0 comments
trafficstars

Thanks for providing this module, it's tremendously helpful!

> import { parse } from "./deps.ts"
undefined
> parse("<foo>001</foo>")
{ foo: 1 }
> parse("<foo>313130e130</foo>")
{ foo: 3.1313e+135 }
> parse("<foo>313130e123</foo>")
{ foo: 3.1313e+128 }

I think it should definitely not be turned on by default, because you might end up losing important information if you're not careful.

As a side-note, usually options like this are designed so that an explicit value of undefined corresponds to the default behavior, which is not the case here. Just wanted to mention that, but I don't really know what to call it other than reviveNumbers.

denizdogan avatar May 27 '23 18:05 denizdogan