Function
removeFromQueue
(map: Map<string, string[]>, key: string, value: string)
Source from the content-addressed store, hash-verified
| 97 | } |
| 98 | |
| 99 | function removeFromQueue(map: Map<string, string[]>, key: string, value: string): void { |
| 100 | const queue = map.get(key); |
| 101 | if (!queue || queue.length === 0) { |
| 102 | return; |
| 103 | } |
| 104 | const nextQueue = queue.filter((entry) => entry !== value); |
| 105 | if (!nextQueue.length) { |
| 106 | map.delete(key); |
| 107 | } else { |
| 108 | map.set(key, nextQueue); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | function extractSessionId(value: unknown): string | null { |
| 113 | if (!isObject(value)) { |
Tested by
no test coverage detected