From 9329d6a0ff83f560ad18f9a77879453b257efb38 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Sun, 2 Aug 2026 15:52:30 +0530 Subject: [PATCH] fix: code quality and safety improvements --- src/services/rankHistoryService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/rankHistoryService.js b/src/services/rankHistoryService.js index 597cd60..2f1aeb0 100644 --- a/src/services/rankHistoryService.js +++ b/src/services/rankHistoryService.js @@ -26,7 +26,7 @@ export const saveRankSnapshot = async (uid, rank, totalPoints, timezone) => { // Extract number from "#42" or similar const numericRank = typeof rank === "string" ? parseInt(rank.replace(/[^0-9]/g, ""), 10) : rank; - if (isNaN(numericRank)) return; + if (Number.isNaN(numericRank)) return; const timeZone = resolveTimezone(timezone); const todayStr = toLocalDateString(new Date(), timeZone);