Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/devcard/[username].ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default async function handler(req) {
try {
const url = new URL(req.url);
const parts = url.pathname.split("/");
const usernameParam = parts[parts.length - 1];
const usernameParam = parts.at(-1);
const username = decodeURIComponent(usernameParam).replace(/\.svg$/, "");
const themeName = url.searchParams.get("theme") || "dark";

Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboard/RankingBreakdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const RankingBreakdown = ({ userData }) => {
.slice(1)
.map((p) => `L ${p.x} ${p.y}`)
.join(" ");
const area = `${path} L ${points[points.length - 1].x} ${chartHeight - paddingY} L ${points[0].x} ${chartHeight - paddingY} Z`;
const area = `${path} L ${points.at(-1).x} ${chartHeight - paddingY} L ${points[0].x} ${chartHeight - paddingY} Z`;

return {
points,
Expand Down
2 changes: 1 addition & 1 deletion src/services/rankHistoryService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/githubRateLimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* and returns structured rate limit info.
*/
export const parseRateLimitHeaders = (headers) => {
const remaining = parseInt(headers?.["x-ratelimit-remaining"] ?? -1);
const remaining = parseInt(headers?.["x-ratelimit-remaining"] ?? -1, 10);
const limit = parseInt(headers?.["x-ratelimit-limit"] ?? -1);
const resetTimestamp = parseInt(headers?.["x-ratelimit-reset"] ?? 0);

Expand Down
Loading