mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Normalize paths by removing both leading and trailing slashes
This commit is contained in:
@@ -72,8 +72,10 @@ export function treeFromFilesystem(files: SvelteSet<string>): TreeItem[] {
|
||||
const tree: TreeItem[] = [];
|
||||
|
||||
for (const path of Array.from(files)) {
|
||||
const normalizedPath = path.endsWith('/') ? path.slice(0, -1) : path;
|
||||
|
||||
let normalizedPath = path.endsWith('/') ? path.slice(0, -1) : path;
|
||||
if (normalizedPath.startsWith('/')) {
|
||||
normalizedPath = normalizedPath.slice(1);
|
||||
}
|
||||
if (!normalizedPath) continue;
|
||||
|
||||
const parts = normalizedPath.split('/');
|
||||
|
||||
Reference in New Issue
Block a user