mafintosh / gunzip-maybe

Transform stream that gunzips its input if it is gzipped and just echoes it if not
MIT License
105 stars 16 forks source link

Use `zlib.createUnzip()` #10

Open piranna opened 1 year ago

piranna commented 1 year ago

https://github.com/mafintosh/gunzip-maybe/blob/6903d9cedc713d10d7978c9bc9e4d7f3539cf249/index.js#L19-L28

It looks like createUnzip() already does detection between Gunzip and Inflate, so there's no need to do it ourselves, reducing code size and number of dependencies.

piranna commented 1 year ago

Also, since this project is not just Gunzip-only anymore, maybe should it be renamed to unzip-maybe? :-)