( snapshot: WorkspaceActivitySnapshot | null, activeWorkflowRunCount: number )
| 1525 | } |
| 1526 | |
| 1527 | function mergeActiveWorkflowRunCount( |
| 1528 | snapshot: WorkspaceActivitySnapshot | null, |
| 1529 | activeWorkflowRunCount: number |
| 1530 | ): WorkspaceActivitySnapshot { |
| 1531 | assert(activeWorkflowRunCount >= 0, "active workflow run count must be non-negative"); |
| 1532 | const merged: WorkspaceActivitySnapshot = { ...(snapshot ?? createDefaultActivitySnapshot()) }; |
| 1533 | if (activeWorkflowRunCount > 0) { |
| 1534 | merged.activeWorkflowRunCount = activeWorkflowRunCount; |
| 1535 | } else { |
| 1536 | delete merged.activeWorkflowRunCount; |
| 1537 | } |
| 1538 | return merged; |
| 1539 | } |
| 1540 | |
| 1541 | // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging |
| 1542 | export class WorkspaceService extends EventEmitter { |
no test coverage detected