mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-15 11:22:15 +03:00
test(sse): drop the dead collectSSE helper that reds the lint gate
#12151 landed with a never-called collectSSE helper in stream-passthrough-usage-estimation.test.ts; its three unused identifiers (collectSSE / stream / writable) fail 'npm run lint:json -- --max-warnings 0', so the 'No new ESLint warnings' job reds every PR merge-ref cut from the current tip (first seen on PR #11564's post-sync run). createSSEStream and parseSSEUsage are actually used and stay; only the dead closure goes. File suite still passes 6/6.
This commit is contained in:
@@ -34,24 +34,6 @@ test("passthrough no fake: tool_only contentLength==0 -> no estimate (tool_calls
|
||||
|
||||
import { createSSEStream } from "../../open-sse/utils/stream.ts";
|
||||
|
||||
function collectSSE(stream: TransformStream<Uint8Array, Uint8Array>) {
|
||||
return async (writable: WritableStream<Uint8Array>, readable: ReadableStream<Uint8Array>) => {
|
||||
const chunks: string[] = [];
|
||||
const decoder = new TextDecoder();
|
||||
const reader = readable.getReader();
|
||||
try {
|
||||
while (true) {
|
||||
const { done, value } = await reader.read();
|
||||
if (done) break;
|
||||
chunks.push(decoder.decode(value, { stream: true }));
|
||||
}
|
||||
} finally {
|
||||
reader.releaseLock();
|
||||
}
|
||||
return chunks.join("");
|
||||
};
|
||||
}
|
||||
|
||||
function parseSSEUsage(sseText: string): unknown[] {
|
||||
return sseText
|
||||
.split("\n\n")
|
||||
|
||||
Reference in New Issue
Block a user