MCPcopy
hub / github.com/openclaw/clawsweeper / topMaintainerRows

Function topMaintainerRows

src/repair/notify-maintainer-report.ts:283–304  ·  view source on GitHub ↗
(report: JsonObject)

Source from the content-addressed store, hash-verified

281}
282
283function topMaintainerRows(report: JsonObject): string[] {
284 const rows = Array.isArray(report.maintainers) ? report.maintainers.map(asJsonObject) : [];
285 return rows
286 .filter((row) => {
287 const github = asJsonObject(row.github);
288 const discord = asJsonObject(row.discord);
289 return numberValue(github.total) > 0 || numberValue(discord.total) > 0;
290 })
291 .slice(0, MAX_HIGHLIGHTS)
292 .map((row) => {
293 const github = asJsonObject(row.github);
294 const discord = asJsonObject(row.discord);
295 const bits = [
296 metric(github.commits, "commits"),
297 metric(github.prsMerged, "merged PRs"),
298 metric(github.issueComments, "comments"),
299 metric(discord.total, "Discord messages"),
300 ].filter(Boolean);
301 const name = stringOrNull(row.name) ?? `@${stringOrNull(row.login) ?? "unknown"}`;
302 return `${name}: ${bits.slice(0, 3).join(", ") || "activity"}`;
303 });
304}
305
306function metric(value: unknown, label: string): string {
307 const number = numberValue(value);

Callers 1

Calls 4

asJsonObjectFunction · 0.90
metricFunction · 0.85
numberValueFunction · 0.70
stringOrNullFunction · 0.70

Tested by

no test coverage detected