MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / normalizeLabel

Function normalizeLabel

frontend/app/treeview/treeview.tsx:82–89  ·  view source on GitHub ↗
(node: TreeNodeData)

Source from the content-addressed store, hash-verified

80const ChevronWidth = 16;
81
82function normalizeLabel(node: TreeNodeData): string {
83 if (node.label?.trim()) {
84 return node.label;
85 }
86 const path = node.path ?? node.id;
87 const chunks = path.split("/").filter(Boolean);
88 return chunks[chunks.length - 1] ?? path;
89}
90
91function sortIdsByNode(nodesById: Map<string, TreeNodeData>, ids: string[]): string[] {
92 return [...ids].sort((leftId, rightId) => {

Callers 3

sortIdsByNodeFunction · 0.85
appendNodeFunction · 0.85
getNodeIconFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected