( folders: Record<string, WorkflowFolder>, folderId: string )
| 43 | } |
| 44 | |
| 45 | export function getFolderPath( |
| 46 | folders: Record<string, WorkflowFolder>, |
| 47 | folderId: string |
| 48 | ): WorkflowFolder[] { |
| 49 | const path: WorkflowFolder[] = [] |
| 50 | let currentId: string | null = folderId |
| 51 | |
| 52 | while (currentId && folders[currentId]) { |
| 53 | const folder: WorkflowFolder = folders[currentId] |
| 54 | path.unshift(folder) |
| 55 | currentId = folder.parentId |
| 56 | } |
| 57 | |
| 58 | return path |
| 59 | } |
no test coverage detected