mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-10-30 09:16:55 +00:00
fix(studio-server): bridge the node web stream type for the Windows build (#3746)
tsc on the Windows jobs rejects a direct cast from node:stream/web's ReadableStream to the global one (TS2352), which broke the build after #3745. Cast through unknown, the bridge the error itself recommends.
This commit is contained in:
@@ -592,7 +592,11 @@ export function registerPreviewRoutes(api: Hono, adapter: PreviewApiAdapter): vo
|
||||
const bodyFor = (start: number, end: number): BodyInit =>
|
||||
textBuffer
|
||||
? new Uint8Array(textBuffer.subarray(start, end + 1))
|
||||
: (Readable.toWeb(createReadStream(servedPath, { start, end })) as ReadableStream);
|
||||
: // Node's web stream type and the DOM one do not overlap for tsc on
|
||||
// every platform's lib set; the double cast is the documented bridge.
|
||||
(Readable.toWeb(
|
||||
createReadStream(servedPath, { start, end }),
|
||||
) as unknown as ReadableStream);
|
||||
|
||||
// Support byte-range requests so browsers can seek audio/video elements.
|
||||
const rangeHeader = c.req.header("Range");
|
||||
|
||||
Reference in New Issue
Block a user