Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 22x 22x 22x 22x 204x 22x 43x 43x 43x 43x 22x 57x 57x 57x | import {SessionInterface} from '../types'; import {SessionStorage} from '../session_storage'; export class MemorySessionStorage implements SessionStorage { private sessions: {[id: string]: SessionInterface} = {}; public async storeSession(session: SessionInterface): Promise<boolean> { this.sessions[session.id] = session; return true; } public async loadSession(id: string): Promise<SessionInterface | undefined> { return this.sessions[id] || undefined; } public async deleteSession(id: string): Promise<boolean> { if (this.sessions[id]) { delete this.sessions[id]; } return true; } } |