mirror of
https://github.com/Egonex-AI/Understand-Anything.git
synced 2026-06-22 10:58:03 +08:00
refactor: extract endpoint label into variable to avoid duplicated template
The endpoint name template was evaluated twice — once for name and once for summary. A single const removes the duplication and resolves the nested template literal lint warning.
This commit is contained in:
@@ -328,14 +328,15 @@ export class GraphBuilder {
|
||||
console.warn(`[GraphBuilder] Duplicate node ID "${childId}" — skipping`);
|
||||
continue;
|
||||
}
|
||||
const name = `${ep.method ?? ""} ${ep.path}`.trim()
|
||||
this.nodeIds.add(childId);
|
||||
this.nodes.push({
|
||||
id: childId,
|
||||
type: "endpoint",
|
||||
name: `${ep.method ?? ""} ${ep.path}`.trim(),
|
||||
name,
|
||||
filePath,
|
||||
lineRange: ep.lineRange,
|
||||
summary: `Endpoint: ${ep.method ?? ""} ${ep.path}`.trim(),
|
||||
summary: `Endpoint: ${name}`,
|
||||
tags: [],
|
||||
complexity: meta.complexity,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user