MCPcopy Create free account
hub / github.com/codename-co/stack / roundStars

Function roundStars

packages/scripts/maintenance/sync-metadata.ts:113–117  ·  view source on GitHub ↗

* Stars move constantly; rewriting 200 files because a project gained three * stars produces daily noise PRs that nobody reads. We round to the same * precision the hub already uses (3 significant digits) and only write when * that rounded value actually moves.

(stars: number)

Source from the content-addressed store, hash-verified

111 * that rounded value actually moves.
112 */
113function roundStars(stars: number): number {
114 if (stars < 1000) return Math.round(stars / 10) * 10;
115 const magnitude = 10 ** (Math.floor(Math.log10(stars)) - 2);
116 return Math.round(stars / magnitude) * magnitude;
117}
118
119/** Trailing slashes and http:// are cosmetic differences, not real drift. */
120const canonical = (url: string) =>

Callers 1

syncEntryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected