-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encode support #1
Comments
A basic implementation of a TOML serialization should be easy and straightforward to do. However, when I initially thought about doing a These concern excluded, writing a serializer that only cares about producing a valid TOML representation of an object shouldn't be too difficult.
|
I've implemented a TOML serializer in #2, which is much, much faster than the other parsers 🎉 (I honestly have no clue where the 4x performance improvement comes from, but I'm very happy with it). The serializer in its current shape has the following gotchas, as documented in the updated README:
|
Wow, that was quick! 🥳 |
Yeah, a simple serializer isn't hard to build, though it's fairly minimal and its only concern as of now is to generate a valid toml representation of an object, with the only "fancy" feature being support for generating arrays of tables using the I want to add additional formatting options to the For a little comparison, this is what title = "TOML Example"
[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00.000-08:00
[database]
enabled = true
ports = [ 8000, 8001, 8002 ]
data = [ [ "delta", "phi" ], [ 3.14 ] ]
[database.temp_targets]
cpu = 79.5
case = 72
[servers]
[servers.alpha]
ip = "10.0.0.1"
role = "frontend"
[servers.beta]
ip = "10.0.0.2"
role = "backend" vs. what title = "TOML Example"
[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T15:32:00.000Z
[database]
enabled = true
ports = [ 8_000, 8_001, 8_002 ]
data = [ [ "delta", "phi" ], [ 3.14 ] ]
[database.temp_targets]
cpu = 79.5
case = 72
[servers.alpha]
ip = "10.0.0.1"
role = "frontend"
[servers.beta]
ip = "10.0.0.2"
role = "backend" Most notable differences are:
Version 1.1.0 with the |
I am trying to find a replacement for
@iarna/toml
since that doesn't have full spec 1.0 support as far as I know. I would love to see encoding support implemented for this library 😊The text was updated successfully, but these errors were encountered: