All files / server/services ws-session-lifecycle.ts

90% Statements 9/10
100% Branches 0/0
85.71% Functions 6/7
87.5% Lines 7/8

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  22x 55x 190x 53x 144x 187x 2x      
export class WsSessionLifecycle<K, V> {
  private readonly sessions = new Map<K, V>();
  register(key: K, value: V): void { this.sessions.set(key, value); }
  get(key: K): V | undefined { return this.sessions.get(key); }
  remove(key: K): V | undefined { const value = this.sessions.get(key); this.sessions.delete(key); return value; }
  entries(): IterableIterator<[K, V]> { return this.sessions.entries(); }
  values(): IterableIterator<V> { return this.sessions.values(); }
  get size(): number { return this.sessions.size; }
  clear(): void { this.sessions.clear(); }
}