"use strict";const fs=require("fs"),zlib=require("zlib"),utils=require("../utils"),streamifier=require("streamifier");class GzipFileStream extends zlib.Gzip{constructor(e){super((e=e||{}).zlib);const r=utils.sourceType(e.source);if("file"===r){const r=fs.createReadStream(e.source,e.fs);return r.on("error",e=>this.emit("error",e)),void r.pipe(this)}if("buffer"===r){const r=streamifier.createReadStream(e.source,e.streamifier);return r.on("error",e=>this.emit("error",e)),void r.pipe(this)}"stream"===r&&(e.source.on("error",e=>this.emit("error",e)),e.source.pipe(this))}}module.exports=GzipFileStream;