MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveFolderPath

Function resolveFolderPath

apps/sim/lib/copilot/chat/workspace-context.ts:460–470  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

458 const folderPathMap = new Map<string, string>()
459 const folderById = new Map(folderRows.map((f) => [f.id, f]))
460 function resolveFolderPath(id: string): string {
461 const cached = folderPathMap.get(id)
462 if (cached !== undefined) return cached
463 const folder = folderById.get(id)
464 if (!folder) return id
465 const parentPath = folder.parentId ? resolveFolderPath(folder.parentId) : ''
466 const normalizedName = normalizeVfsSegment(folder.name)
467 const path = parentPath ? `${parentPath}/${normalizedName}` : normalizedName
468 folderPathMap.set(id, path)
469 return path
470 }
471
472 return {
473 workspace: wsRow,

Callers 1

buildWorkspaceMdDataFunction · 0.70

Calls 3

normalizeVfsSegmentFunction · 0.90
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected