(session: Session, status?: Exclude<SessionStatus, 'ok'>)
| 118 | * it is changed to `'exited'`. |
| 119 | */ |
| 120 | export function closeSession(session: Session, status?: Exclude<SessionStatus, 'ok'>): void { |
| 121 | let context = {}; |
| 122 | if (status) { |
| 123 | context = { status }; |
| 124 | } else if (session.status === 'ok') { |
| 125 | context = { status: 'exited' }; |
| 126 | } |
| 127 | |
| 128 | updateSession(session, context); |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * Serializes a passed session object to a JSON object with a slightly different structure. |
no test coverage detected