mirror of
https://github.com/System-End/github-readme-stats.git
synced 2026-04-19 16:38:23 +00:00
Fixed layout toLowerCase bug (#2770)
This commit is contained in:
parent
1a2a82c3be
commit
98b047751e
2 changed files with 11 additions and 1 deletions
|
|
@ -44,6 +44,16 @@ export default async (req, res) => {
|
|||
return res.send(renderError("Something went wrong", "Locale not found"));
|
||||
}
|
||||
|
||||
if (
|
||||
layout !== undefined &&
|
||||
(typeof layout !== "string" ||
|
||||
!["compact", "normal", "donut", "donut-vertical", "pie"].includes(layout))
|
||||
) {
|
||||
return res.send(
|
||||
renderError("Something went wrong", "Incorrect layout input"),
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
const topLangs = await fetchTopLanguages(
|
||||
username,
|
||||
|
|
|
|||
|
|
@ -746,7 +746,7 @@ const renderTopLanguages = (topLangs, options = {}) => {
|
|||
totalLanguageSize,
|
||||
hide_progress,
|
||||
);
|
||||
} else if (layout?.toLowerCase() === "donut") {
|
||||
} else if (layout === "donut") {
|
||||
height = calculateDonutLayoutHeight(langs.length);
|
||||
width = width + 50; // padding
|
||||
finalLayout = renderDonutLayout(langs, width, totalLanguageSize);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue