From 49050c8b6207d63b4ff01dbe49b744650d5d80ae Mon Sep 17 00:00:00 2001 From: Ali Mahallati Date: Tue, 21 Oct 2025 23:59:17 +0330 Subject: [PATCH 1/2] fix: showing NaN for Npm Downloads in the tanstack/config page Handle non-finite values for npm download count. --- src/components/OpenSourceStats.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/OpenSourceStats.tsx b/src/components/OpenSourceStats.tsx index 0731ea23..08da13dc 100644 --- a/src/components/OpenSourceStats.tsx +++ b/src/components/OpenSourceStats.tsx @@ -58,6 +58,9 @@ const NpmDownloadCounter = ({ npmData: Parameters[0] }) => { const { count, intervalMs } = useNpmDownloadCounter(npmData) + if (!Number.isFinite(count)) { // this returns true for NaN, Infinty / -Infinty, null, undefined + return '-' + } return } From ce1d73010219a5a0f938b69e724545826d613bb4 Mon Sep 17 00:00:00 2001 From: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com> Date: Tue, 11 Nov 2025 13:11:13 +1300 Subject: [PATCH 2/2] style: run prettier --- src/components/OpenSourceStats.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/OpenSourceStats.tsx b/src/components/OpenSourceStats.tsx index 08da13dc..d1654d74 100644 --- a/src/components/OpenSourceStats.tsx +++ b/src/components/OpenSourceStats.tsx @@ -58,7 +58,8 @@ const NpmDownloadCounter = ({ npmData: Parameters[0] }) => { const { count, intervalMs } = useNpmDownloadCounter(npmData) - if (!Number.isFinite(count)) { // this returns true for NaN, Infinty / -Infinty, null, undefined + if (!Number.isFinite(count)) { + // this returns true for NaN, Infinty / -Infinty, null, undefined return '-' } return