fixes, style

This commit is contained in:
martin-mfg
2025-05-21 19:36:28 +00:00
parent bfe9ed2799
commit 6fe3bbb12f
3 changed files with 59 additions and 44 deletions
+14 -9
View File
@@ -2,7 +2,8 @@ import { renderRepoCard } from "../src/cards/repo-card.js";
import { blacklist } from "../src/common/blacklist.js";
import {
clampValue,
CONSTANTS, parseArray,
CONSTANTS,
parseArray,
parseBoolean,
renderError,
} from "../src/common/utils.js";
@@ -61,16 +62,20 @@ export default async (req, res) => {
const safePattern = /^[\w\/.]+$/;
if (
(username && !safePattern.test(username)) ||
(repos && !safePattern.test(repo))
(repo && !safePattern.test(repo))
) {
return res.send(
renderError("Something went wrong", "Username or repository contains unsafe characters", {
title_color,
text_color,
bg_color,
border_color,
theme,
}),
renderError(
"Something went wrong",
"Username or repository contains unsafe characters",
{
title_color,
text_color,
bg_color,
border_color,
theme,
},
),
);
}