MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / classExpressionHead

Function classExpressionHead

src/extraction/tree-sitter.ts:481–483  ·  view source on GitHub ↗

A class expression's head, `class Widget extends Base`: its text up to the body. Mirrored in the kernel (tsjs extract_class).

(source: string, node: SyntaxNode, body: SyntaxNode)

Source from the content-addressed store, hash-verified

479
480/** A class expression's head, `class Widget extends Base`: its text up to the body. Mirrored in the kernel (tsjs extract_class). */
481function classExpressionHead(source: string, node: SyntaxNode, body: SyntaxNode): string {
482 return source.substring(node.startIndex, body.startIndex).replace(/[ \t\r\n]+$/, '');
483}
484
485/** Receiver node types (TS/JS grammars) that continue a member chain downward. */
486const TS_JS_CHAIN_RECEIVER_TYPES = new Set(['member_expression', 'subscript_expression']);

Callers 1

extractClassMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected