Trim whitespace in sanitizePath function (#215)
Add whitespace trimming to sanitizePath function.
This commit is contained in:
@@ -9,6 +9,7 @@ export function cn(...inputs: ClassValue[]) {
|
|||||||
|
|
||||||
|
|
||||||
export function sanitizePath(input: string, os: string): string {
|
export function sanitizePath(input: string, os: string): string {
|
||||||
|
let sanitized = input.trim(); // it will trim whitespace
|
||||||
if (os === "Windows") {
|
if (os === "Windows") {
|
||||||
return input.replace(/[<>:"/\\|?*]/g, "_");
|
return input.replace(/[<>:"/\\|?*]/g, "_");
|
||||||
}
|
}
|
||||||
@@ -56,4 +57,4 @@ export function openExternal(url: string) {
|
|||||||
window.open(url, "_blank", "noopener,noreferrer");
|
window.open(url, "_blank", "noopener,noreferrer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user