TOML codec: decoding with Formata.Toml.decode/2 (forked from gsmlg_toml), encoding with
Formata.Codec.TOML.Encoder.
Decoding
- The root is always a map (table); keys stay strings.
inf,-inf,nanbecome:infinity,:negative_infinity,:nan.- Local date, local time, and local date-time become
Date,Time, andNaiveDateTime. - Offset date-times become UTC
DateTimevalues.Formata.Tomlconverts the instant to UTC, so the original offset (for example-08:00) is not preserved; the instant is. - Duplicate keys and table redefinitions are rejected by the decoder as
:parse/:syntaxerrors. - Line/column are included when the decoder reports them.
Options: :filename (used in decoder messages).
Encoding
See Formata.Codec.TOML.Encoder for the accepted domain. nil has no TOML
representation and is rejected; use Formata.Transform.drop_nils/1 or
Formata.Transform.replace_nils/2 explicitly when that loss is acceptable.