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.
The AST node to search within for class declarations
The SgNode representing the class or null if not found
const classNode = inspectClass(rootNode)if (classNode) { console.log('Found class:', classNode.text())} Copy
const classNode = inspectClass(rootNode)if (classNode) { console.log('Found class:', classNode.text())}
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.