commit 5aef8fce8711e266b1819c3e9588bc3034b3c086
parent c8033ebd84c75a950f7352c4594f5efbdce42e33
Author: triesap <triesap@radroots.dev>
Date: Wed, 31 Dec 2025 10:37:10 +0000
tangle: wrap file handle writer in WritableStream
- Create WritableStream facade over FileSystemWritableFileStream
- Map write and close to underlying stream methods
- Pipe gzip-compressed tar output into wrapper stream
- Improve compatibility with pipeTo Web Streams expectations
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/client/src/tangle/web.ts b/client/src/tangle/web.ts
@@ -911,9 +911,13 @@ const export_tar_gz = async (filename: string, entries: TarEntry[], mtime: numbe
]
});
const stream = await handle.createWritable();
+ const writable_stream = new WritableStream<Uint8Array>({
+ write: (chunk) => stream.write(chunk),
+ close: () => stream.close()
+ });
await tar_stream(entries, mtime)
.pipeThrough(new CompressionStream("gzip"))
- .pipeTo(stream);
+ .pipeTo(writable_stream);
return;
} catch (e) {
if (!is_permission_error(e)) throw e;