ts-api-utils - v3.0.0-rc.1
    Preparing search index...

    Function iterateComments

    • Iterates over all comments owned by node or its children.

      Parameters

      • node: Node
      • sourceFile: SourceFile = ...

      Returns Generator<Comment>

      declare const node: ts.Node;

      for (const {pos, text} of iterateComment(node) {
      console.log(`Found comment at position ${pos}: '${text}'.`);
      };