MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / formatStars

Function formatStars

apps/marketing/src/lib/github.ts:19–21  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

17
18/** Compact star count, e.g. 1234 -> "1.2k". */
19export function formatStars(n: number): string {
20 return n >= 1000 ? `${(n / 1000).toFixed(1).replace(/\.0$/, "")}k` : String(n);
21}
22
23const TTL_OK_MS = 30 * 60 * 1000; // cache a real count for ~30 min per isolate
24const TTL_FAIL_MS = 60 * 1000; // but retry soon after a miss, never pin a null

Callers

nothing calls this directly

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected