( folderId: string | null | undefined, foldersMap: Map<string, FolderExportData> )
| 204 | } |
| 205 | |
| 206 | function buildFolderPath( |
| 207 | folderId: string | null | undefined, |
| 208 | foldersMap: Map<string, FolderExportData> |
| 209 | ): string { |
| 210 | if (!folderId) return '' |
| 211 | |
| 212 | const path: string[] = [] |
| 213 | let currentId: string | null = folderId |
| 214 | |
| 215 | while (currentId && foldersMap.has(currentId)) { |
| 216 | const folder: FolderExportData = foldersMap.get(currentId)! |
| 217 | path.unshift(sanitizePathSegment(folder.name)) |
| 218 | currentId = folder.parentId |
| 219 | } |
| 220 | |
| 221 | return path.join('/') |
| 222 | } |
| 223 | |
| 224 | export async function exportWorkspaceToZip( |
| 225 | workspaceName: string, |
no test coverage detected