mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
parent
296bbeb2fc
commit
f69ce6ad8a
11 changed files with 135 additions and 159 deletions
|
|
@ -2,7 +2,9 @@ export interface RecursiveObject {
|
|||
[key: string]: RecursiveObject;
|
||||
}
|
||||
|
||||
export function buildFolderTree(paths: string[]) {
|
||||
export const normalizeTreePath = (path: string) => path.replace(/^\//, '').replace(/\/$/, '');
|
||||
|
||||
export function buildTree(paths: string[]) {
|
||||
const root: RecursiveObject = {};
|
||||
for (const path of paths) {
|
||||
const parts = path.split('/');
|
||||
Loading…
Add table
Add a link
Reference in a new issue