Nog CLI Developer Guide - v0.11.0
    Preparing search index...

    Utility class for attaching Synthetic Trivia (comments) to TypeScript AST nodes. Designed to be injected via Dependency Injection for modular AST manipulation.

    Index

    Constructors

    Methods

    • Formats a raw string description into a JSDoc comment and attaches it to the given AST node. If the description is empty or undefined, the node is returned unmodified.

      Type Parameters

      • T extends Node

      Parameters

      • node: T

        The TypeScript AST node to attach the comment to.

      • Optionaldescription: string

        The raw text description from the OpenAPI spec.

      Returns T

      The AST node, potentially mutated with a synthetic leading comment.

    • Attaches a standard single-line comment (//) to the given AST node.

      Type Parameters

      • T extends Node

      Parameters

      • node: T

        The TypeScript AST node to attach the comment to.

      • Optionaltext: string

        The comment text.

      Returns T

      The AST node with the attached single-line comment.