fix(stream): remove UnwrapStream, it doesn't work

This commit is contained in:
Simon Chan 2024-10-13 01:54:22 +08:00
parent d862077c34
commit 6a18fa293b
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
6 changed files with 13 additions and 37 deletions

View file

@ -6,8 +6,6 @@ import {
MaybeConsumable,
PushReadableStream,
tryClose,
WrapWritableStream,
WritableStream,
} from "@yume-chan/stream-extra";
import type { ValueOrPromise } from "@yume-chan/struct";
@ -36,7 +34,7 @@ function nodeSocketToConnection(
tryClose(controller);
});
}),
writable: new WritableStream<Uint8Array>({
writable: new MaybeConsumable.WritableStream<Uint8Array>({
write: (chunk) => {
return new Promise<void>((resolve, reject) => {
socket.write(chunk, (err) => {
@ -100,9 +98,7 @@ export class AdbServerNodeTcpConnector
await handler({
service: address!,
readable: connection.readable,
writable: new WrapWritableStream(
connection.writable,
).bePipedThroughFrom(new MaybeConsumable.UnwrapStream()),
writable: connection.writable,
get closed() {
return connection.closed;
},