Skip to content

IniDocument

IniDocument = object

Defined in: packages/format-ini/src/ast.ts:11

A parsed INI document, in source order.

The tree keeps everything the source contained — comments, blank lines, the exact spelling of a section header, the order sections appeared in — because a consumer that edits a file must be able to write back what it did not touch, and a consumer whose semantics are order-dependent (EditorConfig resolves later matching sections over earlier ones) cannot work from a collapsed object.

readonly nodes: readonly IniNode[]

Defined in: packages/format-ini/src/ast.ts:12


readonly trailingNewline: boolean

Defined in: packages/format-ini/src/ast.ts:21

Whether the source ended with a line terminator.

Tracked rather than inferred, because “ends with a newline” and “has a final empty line” are different documents and a round trip must not turn one into the other.