diff --git a/src/app/api/metrics/activity/route.ts b/src/app/api/metrics/activity/route.ts index 648696291..7e3bf7ff4 100644 --- a/src/app/api/metrics/activity/route.ts +++ b/src/app/api/metrics/activity/route.ts @@ -167,9 +167,9 @@ export async function GET(req: NextRequest) { let limit = limitParam ? parseInt(limitParam, 10) : 10; let offset = offsetParam ? parseInt(offsetParam, 10) : 0; - if (isNaN(limit) || limit < 1) limit = 10; + if (Number.isNaN(limit) || limit < 1) limit = 10; if (limit > 100) limit = 100; - if (isNaN(offset) || offset < 0) offset = 0; + if (Number.isNaN(offset) || offset < 0) offset = 0; const bypass = isMetricsCacheBypassed(req); const cacheKey = metricsCacheKey( diff --git a/src/app/api/metrics/contributions/hourly/route.ts b/src/app/api/metrics/contributions/hourly/route.ts index 6c8740c62..ffdf11c98 100644 --- a/src/app/api/metrics/contributions/hourly/route.ts +++ b/src/app/api/metrics/contributions/hourly/route.ts @@ -19,7 +19,7 @@ export async function GET(req: NextRequest) { const daysParam = req.nextUrl.searchParams.get("days"); const parsedDays = daysParam ? parseInt(daysParam, 10) : NaN; - const days = isNaN(parsedDays) ? 30 : Math.max(1, Math.min(365, parsedDays)); + const days = Number.isNaN(parsedDays) ? 30 : Math.max(1, Math.min(365, parsedDays)); const bypass = isMetricsCacheBypassed(req); const key = metricsCacheKey( session.githubId ?? session.githubLogin, diff --git a/src/app/api/metrics/contributions/route.ts b/src/app/api/metrics/contributions/route.ts index 225440241..6c8140444 100644 --- a/src/app/api/metrics/contributions/route.ts +++ b/src/app/api/metrics/contributions/route.ts @@ -383,7 +383,7 @@ export async function GET(req: NextRequest) { } else { const daysParam = req.nextUrl.searchParams.get("days"); const parsedDays = daysParam ? parseInt(daysParam, 10) : NaN; - days = isNaN(parsedDays) ? 30 : Math.max(1, Math.min(365, parsedDays)); + days = Number.isNaN(parsedDays) ? 30 : Math.max(1, Math.min(365, parsedDays)); } const accountId = req.nextUrl.searchParams.get("accountId"); diff --git a/src/app/api/metrics/productive-hours/route.ts b/src/app/api/metrics/productive-hours/route.ts index 5bb62d383..839a900c4 100644 --- a/src/app/api/metrics/productive-hours/route.ts +++ b/src/app/api/metrics/productive-hours/route.ts @@ -223,7 +223,7 @@ export async function GET(req: NextRequest) { } else { const daysParam = searchParams.get("days"); const parsedDays = daysParam ? parseInt(daysParam, 10) : NaN; - days = isNaN(parsedDays) ? 90 : Math.max(1, Math.min(365, parsedDays)); + days = Number.isNaN(parsedDays) ? 90 : Math.max(1, Math.min(365, parsedDays)); } const accountId = searchParams.get("accountId"); diff --git a/src/app/api/metrics/repos/route.ts b/src/app/api/metrics/repos/route.ts index 11ef12f67..3d7759da1 100644 --- a/src/app/api/metrics/repos/route.ts +++ b/src/app/api/metrics/repos/route.ts @@ -238,7 +238,7 @@ export async function GET(req: NextRequest) { const daysParam = req.nextUrl.searchParams.get("days"); const parsedDays = daysParam ? parseInt(daysParam, 10) : NaN; // Clamp days between 1 and 365 — GitHub Commit Search supports up to ~1 year lookback. - const days = isNaN(parsedDays) ? 30 : Math.max(1, Math.min(365, parsedDays)); + const days = Number.isNaN(parsedDays) ? 30 : Math.max(1, Math.min(365, parsedDays)); const accountId = req.nextUrl.searchParams.get("accountId"); const bypass = isMetricsCacheBypassed(req);