mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
feat(server): fix lint type errors for normalizing server URLs
This commit is contained in:
parent
acd68817e9
commit
2704b1546b
@ -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];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user