( workspace: FrontendWorkspaceMetadata, byId: ReadonlyMap<string, FrontendWorkspaceMetadata>, sectionIds: ReadonlySet<string> )
| 868 | * without re-implementing the parent walk. |
| 869 | */ |
| 870 | export function resolveEffectiveSectionId( |
| 871 | workspace: FrontendWorkspaceMetadata, |
| 872 | byId: ReadonlyMap<string, FrontendWorkspaceMetadata>, |
| 873 | sectionIds: ReadonlySet<string> |
| 874 | ): string | undefined { |
| 875 | if (workspace.subProjectPath && sectionIds.has(workspace.subProjectPath)) { |
| 876 | return workspace.subProjectPath; |
| 877 | } |
| 878 | if (workspace.parentWorkspaceId) { |
| 879 | const parent = byId.get(workspace.parentWorkspaceId); |
| 880 | if (parent) { |
| 881 | return resolveEffectiveSectionId(parent, byId, sectionIds); |
| 882 | } |
| 883 | } |
| 884 | return undefined; |
| 885 | } |
| 886 | |
| 887 | /** |
| 888 | * Build the storage key for a section's expanded state. |
no test coverage detected