Repository navigation
v3.3.0
Added
- Patching (lite): accept
Temporalobjects for date/time values, matching the fullpatch(). The temporal type decides the date/time kind and precision, and the source's separator and zero-offset spelling are kept. RequiresTemporalat runtime, asparse({ temporal: true })does. (#316) - Formatting: add a
minimumTimeDecimalsoption for the fractional-second digits of date/time values. It is a floor, so digits are only ever added:07:32:00withminimumTimeDecimals: 3serializes as07:32:00.000, a time written without seconds gains:00before its fraction, a value that already wrote at least as many digits is left as it is, and a floor above them pads in zeros (07:32:00.123456withminimumTimeDecimals: 9becomes07:32:00.123456000).patch()pads a value it rewrites and leaves untouched rows byte-for-byte. (#316)
Fixed
- Dates: an edited value is no longer rounded down to the source's fractional-digit count, which silently changed it. 750 ms written against a source of
07:32:00.5became09:15:30.7, that is 700 ms. The new value now writes the digits it needs, widened to the source's width when the source declared zeros there:.5becomes.75,.500becomes.750and.500000becomes.750000, while a source of07:32:00.123456, whose digits were all significant, becomes09:15:30.5instead of keeping a width the value cannot fill. (#316) - Dates: preserve sub-millisecond fractional seconds.
parse()→stringify()keeps every source digit (07:32:00.123456stays six digits),temporal: truereturns the full precision, and patching an untouched value no longer shortens it to milliseconds. A source value and an updated value that only differ in how the fraction is spelled (.5against.500) count as equal, while an edit below the millisecond (.123456to.123999) is applied instead of being dropped. (#316)
Full Changelog: v3.2.1...v3.3.0
Version specific links
| Registry | Link |
|---|---|
| https://www.npmjs.com/package/@decimalturn/toml-patch/v/3.3.0 | |
| https://jsr.io/@decimalturn/toml-patch@3.3.0 |