(project: SharedProject)
| 116 | let hash = 0 |
| 117 | for (let i = 0; i < str.length; i++) { |
| 118 | hash = ((hash << 5) - hash + str.charCodeAt(i)) | 0 |
| 119 | } |
| 120 | return Math.abs(hash) % max |
| 121 | } |
| 122 | |
| 123 | function getPreferredWorkspace( |
| 124 | workspaces?: SharedWorkspace[], |
| 125 | workspace?: SharedWorkspace, |
| 126 | ): SharedWorkspace | undefined { |
| 127 | return workspace ?? workspaces?.find(w => w.status === 'ACTIVE') ?? workspaces?.[0] |
| 128 | } |
| 129 | |
| 130 | function getWorkspaceBranchLabel(workspace?: SharedWorkspace): string { |
| 131 | if (!workspace) return '—' |
| 132 | return workspace.workspaceKind === WorkspaceKind.MAIN_DIRECTORY ? 'Project directory' : workspace.branchName |
nothing calls this directly
no test coverage detected