@iarna/toml
2.2.5 · 22 Apr 2020ISC12M / weekRepositoryHomepagenpmAtom feed
2.2.5 is the newest release of 2.x.
In short
12 changed
Release note
With 2.0.0, @iarna/toml supports the TOML v0.5.0 specification. TOML 0.5.0
brings some changes:
Delete characters (U+007F) are not allowed in plain strings. You can include them with
escaped unicode characters, eg\u007f.Integers are specified as being 64bit unsigned values. These are
supported usingBigInts if you are using Node 10 or later.Keys may be literal strings, that is, you can use single quoted strings to
quote key names, so the following is now valid:
'a"b"c' = 123The floating point values
nan,infand-infare supported. The stringifier will no
longer strip NaN, Infinity and -Infinity, instead serializing them as these new values..Datetimes can separate the date and time with a space instead of a T, so
2017-12-01T00:00:00Zcan be written as2017-12-01 00:00:00Z.Datetimes can be floating, that is, they can be represented without a timezone.
These are represented in javascript as Date objects whoseisFloatingproperty is true and
whosetoISOStringmethod will return a representation without a timezone.Dates without times are now supported. Dates do not have timezones. Dates
are represented in javascript as a Date object whoseisDateproperty is true and
whosetoISOStringmethod returns just the date.Times without dates are now supported. Times do not have timezones. Times
are represented in javascript as a Date object whoseisTimeproperty is true and
whosetoISOStringmethod returns just the time.Keys can now include dots to directly address deeper structures, so
a.b = 23is
the equivalent ofa = {b = 23}or[a] b = 23. These can be used both as keys to regular tables and inline tables.Integers can now be specified in binary, octal and hexadecimal by prefixing the
number with0b,0oand0xrespectively. It is now illegal to left
pad a decimal value with zeros.
Some parser details were also fixed:
Negative zero (
-0.0) and positive zero (0.0) are distinct floating point values.Negative integer zero (
-0) is not distinguished from positive zero (0).