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

Function toNodeDetail

src/ui-server/api/wire.ts:141–157  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

139}
140
141export function toNodeDetail(node: Node): WireNodeDetail {
142 const detail: WireNodeDetail = {
143 ...toNodeRef(node),
144 startColumn: node.startColumn,
145 endColumn: node.endColumn,
146 lines: Math.max(1, node.endLine - node.startLine + 1),
147 };
148 if (node.docstring) detail.docstring = node.docstring;
149 if (node.visibility) detail.visibility = node.visibility;
150 if (node.isAsync) detail.async = true;
151 if (node.isStatic) detail.static = true;
152 if (node.isAbstract) detail.abstract = true;
153 if (node.decorators?.length) detail.decorators = node.decorators;
154 if (node.typeParameters?.length) detail.typeParameters = node.typeParameters;
155 if (node.returnType) detail.returnType = node.returnType;
156 return detail;
157}
158
159// =============================================================================
160// Edge shapes

Callers 1

buildNodeFunction · 0.90

Calls 1

toNodeRefFunction · 0.85

Tested by

no test coverage detected