Large integers are not serialized and written properly in serde/fs
Opened this issue · 0 comments
Crystalflxme commented
Reproduction:
# testing.toml
testValue = 5208470842
-- testing.luau
local serde = require("@lune/serde")
local fs = require("@lune/fs")
local testing = serde.decode("toml", fs.readFile("testing.toml"))
fs.writeFile(
`result.json`,
serde.encode("json", {
testValue = testing.testValue,
})
)
Running lune testing
will result in the following json file.
{"testValue":5208470842.0}
In most cases, it seems to preserve integers. However, with larger integers, it appears to append .0
. This can cause issues if the resulting file requires integers.