Creates a new ParseResult instance.
Array of parsed Entry objects
Gets all balance entries from the parsed entries.
Array of entries that are balance directives
Gets all blankline entries from the parsed entries.
Array of entries that are blank lines
Gets all close entries from the parsed entries.
Array of entries that are close directives
Gets all commodity entries from the parsed entries.
Array of entries that are commodity directives
Gets all custom entries from the parsed entries.
Array of entries that are custom directives
Gets all document entries from the parsed entries.
Array of entries that are document directives
Gets all event entries from the parsed entries.
Array of entries that are event directives
Gets all include entries from the parsed entries.
Array of entries that are include directives
Gets all note entries from the parsed entries.
Array of entries that are note directives
Gets all open entries from the parsed entries.
Array of entries that are open directives
Gets all option entries from the parsed entries.
Array of entries that are option directives
Gets all pad entries from the parsed entries.
Array of entries that are pad directives
Gets all plugin entries from the parsed entries.
Array of entries that are plugin directives
Gets all poptag entries from the parsed entries.
Array of entries that are poptag directives
Gets all price entries from the parsed entries.
Array of entries that are price directives
Gets all pushtag entries from the parsed entries.
Array of entries that are pushtag directives
Gets all query entries from the parsed entries.
Array of entries that are query directives
Gets all transaction entries from the parsed entries.
Array of entries that are transactions
Calculates the optimal currency column position for formatting.
The currency column is determined by analyzing all postings across transactions and finding the maximum widths needed for account names and amounts.
Formula: currencyColumn = maxLeftPartLength + maxAmountLength + minPadding + 6
Where:
Optional configuration for the calculation
The calculated currency column position (1-indexed)
Converts all entries to a formatted string with aligned columns. Uses each entry's toFormattedString() method for consistent formatting.
Formatting options
The formatted Beancount file content as a string
Converts all entries to their string representation. Each entry is converted using its toString() method and joined with newlines.
The complete Beancount file content as a string
StaticfromCreates an ParseResult instance from JSON data. Calls fromJSONData to allow subclasses to transform the data before construction.
JSON data representing an ParseResult
A new instance of ParseResult loaded with the data in the JSON
StaticfromCreates a ParseResult instance from a plain JavaScript object. Deserializes each entry by mapping it to the appropriate Entry class based on its type.
Plain object representation of a ParseResult
A new ParseResult instance with deserialized entries
Container class for parsed Beancount entries. Provides methods for converting entries back to string format.