mirror of
https://github.com/badges/shields.git
synced 2026-11-21 16:06:35 +03:00
* [ChromeWebStoreUsers] Fix 1M+ counts rendering as "12000,000" not "12M" The Chrome Web Store reports counts with thousands separators, e.g. "12,000,000". The handler stripped them with a string argument to String.prototype.replace, which only removes the first match, leaving "12000,000". metric() then coerced that to NaN and printed it verbatim. Counts below 1M have a single separator, so they were unaffected. Use a global regex so every separator is removed, and extract the logic into a testable static transform() (mirroring ChromeWebStoreSize) with deterministic unit tests for the millions case. * [ChromeWebStoreUsers] Address review: use replaceAll, drop redundant metric test