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); diff --git a/src/app/api/milestones/route.ts b/src/app/api/milestones/route.ts index 4019a3d7f..19ec9c30c 100644 --- a/src/app/api/milestones/route.ts +++ b/src/app/api/milestones/route.ts @@ -92,7 +92,7 @@ export async function POST(req: Request) { ? unit.trim().slice(0, MAX_UNIT_LEN) : "units"; - if (typeof targetDate !== "string" || isNaN(new Date(targetDate).getTime())) { + if (typeof targetDate !== "string" || Number.isNaN(new Date(targetDate).getTime())) { return NextResponse.json({ error: "targetDate must be a valid date string" }, { status: 400 }); }