@cruglobal/js-hcl2 - v0.1.1
    Preparing search index...

    Class Document

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    body: BodyNode

    Mutable CST root. Edits to the body (via the editing API or by direct mutation) show up in subsequent toString() / toValue() calls.

    source: SourceFile

    The SourceFile wrapping the original input (unchanged by edits — the live CST stays in body).

    Methods

    • Remove an attribute or block at path. Returns true when something was removed, false when the path did not resolve.

      Parameters

      Returns boolean

    • Resolve a path to its CST node. Returns undefined if the path does not exist. For duplicate-block groups with no numeric index given, returns the first matching block (matching HCL.parse's grouping semantics when accessing by key).

      Parameters

      Returns Node | undefined

    • Replace the value of an existing attribute, or insert a new attribute at the end of the enclosing body. The attribute's surrounding trivia (leading comments, same-line trailing comments) is preserved on replacement.

      Parameters

      Returns void

    • Re-emit the current CST. For an unedited Document, this is byte-identical to the original source by construction.

      Returns string