squirrelchat / smol-toml

A small, fast, and correct TOML (1.0.0) parser and serializer
BSD 3-Clause "New" or "Revised" License
146 stars 9 forks source link

Deserialize integers beyond 53bits as bigint #31

Open innermatrix opened 3 weeks ago

innermatrix commented 3 weeks ago
import toml from 'smol-toml'
toml.parse('a=9223372036854775807')

Expected: { a: 9223372036854775807n }

Seen: Exception (Invalid TOML document: integer value cannot be represented losslessly)

cyyynthia commented 3 weeks ago

This is more of a feature req than a bug; the choice was to error for the time being to avoid silently converting to bigint by default (noisy vs silent approach). BigInt support is planned, eventually:tm:

zombieyang commented 1 week ago

Really need this