MCPcopy Create free account
hub / github.com/tiann/hapi / shiftQueue

Function shiftQueue

cli/src/opencode/opencodeLocalLauncher.ts:85–97  ·  view source on GitHub ↗
(map: Map<string, string[]>, key: string)

Source from the content-addressed store, hash-verified

83}
84
85function shiftQueue(map: Map<string, string[]>, key: string): string | null {
86 const queue = map.get(key);
87 if (!queue || queue.length === 0) {
88 return null;
89 }
90 const value = queue.shift() ?? null;
91 if (!queue.length) {
92 map.delete(key);
93 } else {
94 map.set(key, queue);
95 }
96 return value;
97}
98
99function removeFromQueue(map: Map<string, string[]>, key: string, value: string): void {
100 const queue = map.get(key);

Callers 1

handleHookEventFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected