Creates a new ParseResult instance.
Array of parsed nodes
Gets all unique account names used across all directives. Extracts accounts from transactions (via postings), open, close, balance, pad, note, and document nodes.
Set of unique account names
Gets all balance nodes from the parsed nodes.
Array of nodes that correspond to balance directives
Gets all blankline nodes from the parsed nodes.
Array of nodes that correspond to a blank line
Gets all close nodes from the parsed nodes.
Array of nodes that correspond to close directives
Gets all comment nodes from the parsed nodes.
Array of nodes that correspond to a comments
Gets all commodity nodes from the parsed nodes.
Array of nodes that correspond to commodity directives
Gets all custom nodes from the parsed nodes.
Array of nodes that correspond to custom directives
Gets all document nodes from the parsed nodes.
Array of nodes that correspond to document directives
Gets all event nodes from the parsed nodes.
Array of nodes that correspond to event directives
Gets all include nodes from the parsed nodes.
Array of nodes that correspond to include directives
Gets all note nodes from the parsed nodes.
Array of nodes that correspond to note directives
Gets all open nodes from the parsed nodes.
Array of nodes that correspond to open directives
Gets all option nodes from the parsed nodes.
Array of nodes that correspond to option directives
Gets all pad nodes from the parsed nodes.
Array of nodes that correspond to pad directives
Gets all plugin nodes from the parsed nodes.
Array of nodes that correspond to plugin directives
Gets all poptag nodes from the parsed nodes.
Array of nodes that correspond to poptag directives
Gets all price nodes from the parsed nodes.
Array of nodes that correspond to price directives
Gets all pushtag nodes from the parsed nodes.
Array of nodes that correspond to pushtag directives
Gets all query nodes from the parsed nodes.
Array of nodes that correspond to query directives
Gets all transaction nodes from the parsed nodes.
Array of nodes that correspond to transaction directives
Gets all accounts that are active (open and not yet closed) at a given date. An account is considered active if:
The date to check account status for
Set of account names that are active on the given date
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 nodes to a formatted string with aligned columns. Uses each node's toFormattedString() method for consistent formatting.
Formatting options
The formatted Beancount file content as a string
Converts all nodes to their string representation. Each node 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 node by mapping it to the appropriate Node class based on its type.
Plain object representation of a ParseResult
A new ParseResult instance with deserialized nodes
Container class for the result of a parse. Provides methods for converting node back to string format.