From ae8b6104624cb1b84e357adcb39dfa55480693b1 Mon Sep 17 00:00:00 2001 From: SjxSubham Date: Thu, 8 Jan 2026 11:04:08 +0530 Subject: [PATCH] Trim whitespace in sanitizePath function (#215) Add whitespace trimming to sanitizePath function. --- frontend/src/lib/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts index 7cb62ce..e2a5307 100644 --- a/frontend/src/lib/utils.ts +++ b/frontend/src/lib/utils.ts @@ -9,6 +9,7 @@ export function cn(...inputs: ClassValue[]) { export function sanitizePath(input: string, os: string): string { + let sanitized = input.trim(); // it will trim whitespace if (os === "Windows") { return input.replace(/[<>:"/\\|?*]/g, "_"); } @@ -56,4 +57,4 @@ export function openExternal(url: string) { window.open(url, "_blank", "noopener,noreferrer"); } } -} \ No newline at end of file +}