Skip to content

Commit b53807b

Browse files
author
Really Him
committed
Merge remote-tracking branch 'upstream/master'
2 parents 0e47d79 + 42130f1 commit b53807b

22 files changed

Lines changed: 627 additions & 161 deletions

api/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default async (req, res) => {
2121
hide_rank,
2222
show_icons,
2323
include_all_commits,
24+
commits_year,
2425
line_height,
2526
title_color,
2627
ring_color,
@@ -98,6 +99,7 @@ export default async (req, res) => {
9899
showStats.includes("prs_merged_percentage"),
99100
showStats.includes("discussions_started"),
100101
showStats.includes("discussions_answered"),
102+
parseInt(commits_year, 10),
101103
);
102104

103105
let cacheSeconds = clampValue(
@@ -123,6 +125,7 @@ export default async (req, res) => {
123125
card_width: parseInt(card_width, 10),
124126
hide_rank: parseBoolean(hide_rank),
125127
include_all_commits: parseBoolean(include_all_commits),
128+
commits_year: parseInt(commits_year, 10),
126129
line_height,
127130
title_color,
128131
ring_color,

api/top-langs.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default async (req, res) => {
3434
border_color,
3535
disable_animations,
3636
hide_progress,
37+
stats_format,
3738
} = req.query;
3839
res.setHeader("Content-Type", "image/svg+xml");
3940

@@ -85,6 +86,16 @@ export default async (req, res) => {
8586
);
8687
}
8788

89+
if (
90+
stats_format !== undefined &&
91+
(typeof stats_format !== "string" ||
92+
!["bytes", "percentages"].includes(stats_format))
93+
) {
94+
return res.send(
95+
renderError("Something went wrong", "Incorrect stats_format input"),
96+
);
97+
}
98+
8899
try {
89100
const topLangs = await fetchTopLanguages(
90101
username,
@@ -125,6 +136,7 @@ export default async (req, res) => {
125136
locale: locale ? locale.toLowerCase() : null,
126137
disable_animations: parseBoolean(disable_animations),
127138
hide_progress: parseBoolean(hide_progress),
139+
stats_format,
128140
}),
129141
);
130142
} catch (err) {

package-lock.json

Lines changed: 46 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"color-contrast-checker": "^2.1.0",
4848
"eslint": "^9.35.0",
4949
"eslint-config-prettier": "^10.1.8",
50-
"eslint-plugin-jsdoc": "^55.2.0",
50+
"eslint-plugin-jsdoc": "^57.0.8",
5151
"globals": "^16.4.0",
5252
"hjson": "^3.2.2",
5353
"husky": "^9.1.7",
@@ -61,7 +61,7 @@
6161
"prettier": "^3.6.2"
6262
},
6363
"dependencies": {
64-
"axios": "^1.12.1",
64+
"axios": "^1.12.2",
6565
"dotenv": "^17.2.2",
6666
"emoji-name-map": "^2.0.3",
6767
"github-username-regex": "^1.0.0",

0 commit comments

Comments
 (0)