Documentation
    Preparing search index...
    • Returns a node that represents a TypeScript class or null when unable to find the class.

      This function searches for class declarations within the provided AST node using ast-grep's pattern matching capabilities.

      Parameters

      • node: SgNode

        The AST node to search within for class declarations

      Returns null | SgNode<TypesMap, Kinds<TypesMap>>

      The SgNode representing the class or null if not found

      const classNode = inspectClass(rootNode)
      if (classNode) {
      console.log('Found class:', classNode.text())
      }