The stream wrappers in kotlin-web are generically typed.
For example, Response.body will return a ReadableStream<Uint8Array<ArrayBuffer>>.
The pipeTo methods require the same type, which seams overly strict.
It will prevent me streaming the body to FileSystemWritableFileStream which is WritableStream<JsAny>.
The only workaround I found is to 'lie' to the compiler by unchecked casting to a common type.
The stream wrappers in
kotlin-webare generically typed.For example,
Response.bodywill return aReadableStream<Uint8Array<ArrayBuffer>>.The
pipeTomethods require the same type, which seams overly strict.It will prevent me streaming the body to
FileSystemWritableFileStreamwhich isWritableStream<JsAny>.The only workaround I found is to 'lie' to the compiler by unchecked casting to a common type.