1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-24 23:26:50 +02:00

Desktop: Fixes #4426: Improved handling of empty paths for Joplin Server sync target

This commit is contained in:
Laurent Cozic
2021-02-01 10:48:37 +00:00
parent a419e1eb7c
commit b1b5069a23
6 changed files with 40 additions and 50 deletions

View File

@ -138,6 +138,10 @@ export function ltrimSlashes(path: string) {
return path.replace(/^\/+/, '');
}
export function trimSlashes(path: string): string {
return ltrimSlashes(rtrimSlashes(path));
}
export function quotePath(path: string) {
if (!path) return '';
if (path.indexOf('"') < 0 && path.indexOf(' ') < 0) return path;