Documentation
    Preparing search index...
    • Converts an SgNode to plain text by removing whitespaces, indentation and comments in between. Tested with the following children nodes only.

      • MemberExpression
      • Identifier

      This function recursively traverses the AST node and extracts only the meaningful text content without any formatting or whitespace.

      Parameters

      • node: SgNode

        The AST node to convert to plain text

      Returns string

      String representation of the node without formatting

      const memberExpression = node.find({ rule: { kind: 'member_expression' } })
      const plainText = nodeToPlainText(memberExpression)
      console.log(plainText) // 'user.validate'