feat(server): fix lint type errors for normalizing server URLs

This commit is contained in:
perf3ct 2025-06-18 21:07:12 +00:00
parent acd68817e9
commit 2704b1546b
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232

View File

@ -382,7 +382,7 @@ export function safeExtractMessageAndStackFromError(err: unknown): [errMessage:
* @param url The URL to normalize * @param url The URL to normalize
* @returns The normalized URL without trailing slashes * @returns The normalized URL without trailing slashes
*/ */
export function normalizeUrl(url: string): string { export function normalizeUrl(url: string | null | undefined): string | null | undefined {
if (!url || typeof url !== 'string') { if (!url || typeof url !== 'string') {
return url; return url;
} }
@ -412,7 +412,7 @@ export function normalizeUrl(url: string): string {
* @param pattern The original pattern from customRequestHandler attribute * @param pattern The original pattern from customRequestHandler attribute
* @returns An array of patterns to match both with and without trailing slash * @returns An array of patterns to match both with and without trailing slash
*/ */
export function normalizeCustomHandlerPattern(pattern: string): string[] { export function normalizeCustomHandlerPattern(pattern: string | null | undefined): (string | null | undefined)[] {
if (!pattern || typeof pattern !== 'string') { if (!pattern || typeof pattern !== 'string') {
return [pattern]; return [pattern];
} }