Skip to content

v3.0.0

Choose a tag to compare

@github-actions github-actions released this 29 Jul 13:37

Changed

  • BREAKING: Raise minimum supported Node.js version from >=14 to >=16.
  • Patching: introducing explicit comment ownership. Comments describing a key, table, array-of-tables entry or an element inside a multi-line array or inline table now travel with it when removed or reordered via patch(), instead of being left behind to describe whatever ends up in that spot. See docs/CommentOwnership.md. (#259)
  • Improve stringification performance ([0e66e68])

Added

  • TomlDocument: New parseDocument function that parses a TOML string into a TomlDocument
  • Patching: New updateOrder option in TomlFormat. When true, patch() reorders root key-values, section blocks and table-body rows to match the JS object's key order, carrying each entry's comments along. Off by default. Shapes not yet reordered are left in place and reported via console.warn. (#260)

Fixed

  • Patching: Ensure all elements of nested tables are preserved when using inlineTableStart is 2 or higher. (#253)
  • Patching: prevent whitespace errors when swaping keys between tables.
  • Patching: handle BigInt values in documents without throwing. (#255)
  • Patching: handle commented multiline arrays correctly when adding keys or emptying them. (#255)
  • Patching: fix wrong section nesting when replacing a table with a scalar value. (#255)
  • Patching: preserve key with inline empty array when emptying an array-of-tables. (#255)
  • Patching: fix Node not found errors on structural type replacements like nested table-to-scalar and AOT-to-scalar. (#255)
  • Patching: fix remaining structural type replacement bugs — offset corruption when removing multiple sibling tables/AOTs, outer key loss when replacing a table/AOT with an inline object, and errors converting an array-of-tables to a plain array.
  • Patching: preserve +nan / -nan sign through parse and round-trip. (#255)
  • Patching: keep a regenerated root key at root level when a section header survives alongside it — emptying an array-of-tables appended the key past the header, which silently reparented it into that section. (#260)

Full Changelog: v2.1.0...v3.0.0


Version specific links

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