mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-05-14 06:58:59 +00:00
Fixed layout toLowerCase bug (#2770)
This commit is contained in:
committed by
GitHub
parent
1a2a82c3be
commit
98b047751e
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user