/** * node-compress-commons * * Copyright (c) 2014 Chris Talkington, contributors. * Licensed under the MIT license. * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT */varStream=require('stream').Stream;varPassThrough=require('readable-stream').PassThrough;varutil=module.exports={};util.isStream=function(source){returnsourceinstanceofStream;};util.normalizeInputSource=function(source){if(source===null){returnBuffer.alloc(0);}elseif(typeofsource==='string'){returnBuffer.from(source);}elseif(util.isStream(source)&&!source._readableState){varnormalized=newPassThrough();source.pipe(normalized);returnnormalized;}returnsource;};