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

Function groupRows

ui/src/lib/entry-model.ts:111–126  ·  view source on GitHub ↗
(
  placed: ReadonlyArray<{ row: EntryRow; path: string; file: string | null }>
)

Source from the content-addressed store, hash-verified

109 * ranked executable, leads the section.
110 */
111export function groupRows(
112 placed: ReadonlyArray<{ row: EntryRow; path: string; file: string | null }>
113): EntryGroup[] {
114 const groups: EntryGroup[] = [];
115 const byPath = new Map<string, EntryGroup>();
116 for (const { row, path, file } of placed) {
117 let group = byPath.get(path);
118 if (!group) {
119 group = { path, file, rows: [] };
120 byPath.set(path, group);
121 groups.push(group);
122 }
123 group.rows.push(row);
124 }
125 return groups;
126}
127
128/* ------------------------------------------------------------------ rows -- */
129

Callers 2

buildEntryPanelFunction · 0.85

Calls 3

pushMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected