Surgically patch values in the TOML file, preserving comments and formatting.
Accepts a nested object whose leaf values are set in the TOML. Intermediate tables are
created automatically. Setting a leaf to undefined removes it (use remove() for a
clearer API when deleting keys).
Transform the raw TOML string on disk. Reads the file, applies the transform function
to the raw text, writes back, and re-parses to keep content in sync.
Use this for text-level operations that can't be expressed as structured edits —
e.g. Injecting comments or positional insertion of keys in arrays-of-tables.
Subsequent patch() calls will preserve any comments added this way.
A function that receives the raw TOML string and returns the modified string.
StaticreadRead and parse a TOML file from disk. Throws TomlFileError if the file doesn't exist or contains invalid TOML.
Absolute path to the TOML file.
A TomlFile instance with parsed content.
General-purpose TOML file abstraction.
Provides a unified interface for reading, patching, removing keys from, and replacing the content of TOML files on disk.
readpopulates content from diskpatchdoes surgical WASM-based edits (preserves comments and formatting)removedeletes a key by dotted path (preserves comments and formatting)replacedoes a full re-serialization (comments and formatting are NOT preserved).transformRawapplies a function to the raw TOML string on disk.