refactor: add readonly to many read only fields

This commit is contained in:
Simon Chan 2025-04-04 01:28:07 +08:00
parent 05c01adbd1
commit 1d71971281
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
18 changed files with 66 additions and 67 deletions

View file

@ -1,5 +1,4 @@
import type { ReadableStream } from "@yume-chan/stream-extra";
import { PushReadableStream } from "@yume-chan/stream-extra";
import { ReadableStream } from "@yume-chan/stream-extra";
import type { StructValue } from "@yume-chan/struct";
import { buffer, struct, u32 } from "@yume-chan/struct";
@ -52,10 +51,5 @@ export function adbSyncPull(
socket: AdbSyncSocket,
path: string,
): ReadableStream<Uint8Array> {
// TODO: use `ReadableStream.from` when it's supported
return new PushReadableStream(async (controller) => {
for await (const data of adbSyncPullGenerator(socket, path)) {
await controller.enqueue(data);
}
});
return ReadableStream.from(adbSyncPullGenerator(socket, path));
}