Skip to content

v3.0.2

Choose a tag to compare

@github-actions github-actions released this 09 Aug 08:28

Fixed

  • Patching: add an element to an inline array of tables (xs = [{ ... }]) as an inline element rather than emitting a [[xs]] section alongside it, which defined the key twice. (#267)
  • Patching: match a sibling's inner trailing comma when adding an inline table to an array, instead of taking it from the array's own separator ({ z = 0, } beside { a = 1 }). (#267)
  • Patching: match sibling bracket spacing when adding an inline table to an inline array ({ z = 0 } beside { a = 1 }). (#270)
  • Patching: keep an implicit parent table as an empty header when its last child is removed ([a.b] → { a: {} } now produces [a] instead of an empty document). Covers both table ([a.b]) and array-of-tables ([[a.b]]) cases. (#270)
  • Patching: pair renames one target each, so collapsing several equal-valued keys onto one no longer emits a key with an empty name. Keys sharing a value are matched in order, keeping their comments, and only the leftovers become removes or adds. (#269)
  • Patching: rename a [table] section key instead of throwing. The rename path read the key node directly, which only works for a key-value — a section wraps it in a TableKey. (#269)
  • Patching: rename a segment of a dotted section key (e.g. [a.b] → [x.b], [a.b] → [a.y], [a.b.c] → [a.x.c]) instead of throwing. The Rename handler now falls back to key-prefix search and handles segment-count mismatches when the target is rendered as a plain nested key. (#269)
  • Patching: avoid extra blank line when the first array-of-tables entry is converted to a table in-place during implicit parent materialisation. (#271)
  • Stringify: prevent float-to-bigint type change on round-trip. Whole-number values exceeding Number.MAX_SAFE_INTEGER (e.g. 743000000000000000 from TOML 743e+15) are now always emitted with a decimal point so they stay as number on re-parse instead of being promoted to bigint. (#273)
  • Patching: modifying nested dotted-key values that change from a table to a scalar (e.g. a.b.c = 1 → a.b = 42 under [a.b]) no longer emits conflicting inline tables or misplaces the value. (#274)
  • Patching: adding a key to a nested table array element (e.g. [[a.b]]) no longer throws "Incompatible child type 'InlineItem'". (#274)
  • Patching: Move entire AOT entry + owned comments as a unit during reorder so comments follow their entries when updateOrder is enabled.
  • Patching: tighten empty single-line inline tables and propagate to parent containers (#276)
  • Patching: unwrap InlineArrayItem when inserting into nested inline array (#276)
  • Patching: adjust commented out kv behavior to match expected behavior of comment ownership rules (#277)
  • Patching: ensure inline container tightening for deletions (#278)

Full Changelog: v3.0.1...v3.0.2


Version specific links

Registry Link
npm https://www.npmjs.com/package/@decimalturn/toml-patch/v/3.0.2
jsr https://jsr.io/@decimalturn/toml-patch@3.0.2