(sessionId: string)
| 26 | } |
| 27 | |
| 28 | private getOrCreateSession(sessionId: string): SessionData { |
| 29 | if (!this.sessions.has(sessionId)) { |
| 30 | this.sessions.set(sessionId, { |
| 31 | progress: { ...INITIAL_PROGRESS }, |
| 32 | attempts: 0, |
| 33 | hints: HINTS.map(h => ({ ...h })), |
| 34 | solved: false, |
| 35 | }); |
| 36 | } |
| 37 | return this.sessions.get(sessionId)!; |
| 38 | } |
| 39 | |
| 40 | async getProgress(sessionId: string): Promise<Progress> { |
| 41 | const session = this.getOrCreateSession(sessionId); |
no outgoing calls
no test coverage detected