tomlToValue() reconstructs the TOML document object graph by path: dotted keys create nested objects, [table] headers create nested tables (with implicit tables on the way), [[array-of-tables]] headers append elements, and a nested [a.b] after [[a]] attaches to the most recent element. Basic and literal strings unescape, integers honor 0x/0o/0b and underscores (unsafe_integer past Number.MAX_SAFE_INTEGER), floats support inf/nan, booleans project, and date-times stay raw RFC 3339 text strings.
TOML version dialect: '1.0' or '1.1'. Canonical key; wins over spec when both are given.
spec
TomlVersion
No
undefined
Documented alias for version (ADR 0048), matching the unified strict convention’s “spec” vocabulary. An explicit version wins; spec wins over the strict-mode default.
mode
ParseMode
No
'lenient'
Parse mode. Strict mode defaults the version to '1.0' when neither version nor spec is given.
strict
boolean
No
undefined
Convenience alias for mode: 'strict' (ADR 0044). true picks strict, false is the explicit lenient spelling; an explicit mode wins.
parseToml with no options defaults to TOML v1.1.0. Version precedence (highest
to lowest): an explicit version wins over spec, and either wins over the
strict-mode default. parseToml10 and parseToml11 are unaffected.
Strict mode is mechanically enforced against the official toml-test
reference suite (ADR 0034): every .toml file under
corpus/toml-test/invalid/ (511 files across its 16 category
subdirectories) must carry
hasError: true under strict: true with zero false accepts. See
TOML conformance for the ledger.
parseToml defaults to TOML 1.1.0. Use parseToml10(bytes) for strict TOML 1.0.0. Use parseToml(bytes, { version: '1.0' }) or its spec alias parseToml(bytes, { spec: '1.0' }) for explicit version selection; an explicit version wins over spec, and either wins over the strict-mode default.