Closed jespertheend closed 5 months ago
Thank you very much, I must admit I hadn't tested this piece of code. All your comments are pertinent. Would you like me to integrate the changes for you or would you prefer to submit a PR to make your contribution more official?
I can submit a PR!
I wanted to take zip data from a POST request, decompress it and write it to disk. I tried to use this example as a starting point, but ended up running into a couple of issues. https://github.com/gildas-lormeau/zip.js/blob/1cb7354a27a3ad3cacc240d64d3e08ca15b7ee86/index.d.ts#L631-L641
new ZipWriterStream()
is not a valid type forpipeThrough()
. I thinkZipWriterStream
andZipReaderStream
need to be swapped in this example.Deno.create
fails for any files inside subdirectories. A call toensureFile
from std/fs fixed this for me.await
theentry.readable.pipeTo()
call in case an error is thrown. I had wrapped my code with a try catch block but the errors from the second issue weren't caught.This is what ended up working for me: