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