Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { streamToUint8Array } from "../round-trip/round-trip.js";
/**
* Drains `stream` into a `Uint8Array` and feeds it to `processor`. Returns
* the processor's resolved value.
*/
export async function processDataStream<T>(
stream: ReadableStream<Uint8Array>,
processor: (data: Uint8Array) => T | Promise<T>
): Promise<T> {
const bytes = await streamToUint8Array(stream);
return await processor(bytes);
}