MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / top

Function top

apps/api/src/agents/tools/events.ts:50–54  ·  view source on GitHub ↗
(m: Map<string, number>, n: number)

Source from the content-addressed store, hash-verified

48 }
49
50 const top = (m: Map<string, number>, n: number) =>
51 Array.from(m.entries())
52 .sort((a, b) => b[1] - a[1])
53 .slice(0, n)
54 .map(([name, count]) => ({ name, count }));
55
56 return {
57 sample_size: events.length,

Callers 1

events.tsFile · 0.85

Calls 2

mapMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected