function cov_2azy0hzo3d(){var path="/Users/ruyadorno/Documents/workspace/cli/main/packages/libnpmdiff/lib/tarball.js";var hash="86b369d48d1ab068549cbf0ddf36a0693e46d310";var global=new Function("return this")();var gcv="__coverage__";var coverageData={path:"/Users/ruyadorno/Documents/workspace/cli/main/packages/libnpmdiff/lib/tarball.js",statementMap:{"0":{start:{line:1,column:21},end:{line:1,column:36}},"1":{start:{line:3,column:12},end:{line:3,column:38}},"2":{start:{line:4,column:20},end:{line:4,column:65}},"3":{start:{line:5,column:15},end:{line:5,column:32}},"4":{start:{line:6,column:29},end:{line:6,column:46}},"5":{start:{line:7,column:12},end:{line:7,column:26}},"6":{start:{line:11,column:27},end:{line:18,column:5}},"7":{start:{line:12,column:2},end:{line:18,column:5}},"8":{start:{line:14,column:6},end:{line:14,column:59}},"9":{start:{line:14,column:24},end:{line:14,column:58}},"10":{start:{line:17,column:6},end:{line:17,column:55}},"11":{start:{line:20,column:16},end:{line:31,column:1}},"12":{start:{line:21,column:19},end:{line:21,column:37}},"13":{start:{line:22,column:16},end:{line:22,column:43}},"14":{start:{line:24,column:26},end:{line:25,column:85}},"15":{start:{line:27,column:2},end:{line:28,column:45}},"16":{start:{line:28,column:4},end:{line:28,column:45}},"17":{start:{line:30,column:2},end:{line:30,column:49}},"18":{start:{line:33,column:0},end:{line:33,column:24}}},fnMap:{"0":{name:"(anonymous_0)",decl:{start:{line:11,column:27},end:{line:11,column:28}},loc:{start:{line:12,column:2},end:{line:18,column:5}},line:12},"1":{name:"(anonymous_1)",decl:{start:{line:13,column:10},end:{line:13,column:11}},loc:{start:{line:14,column:6},end:{line:14,column:59}},line:14},"2":{name:"(anonymous_2)",decl:{start:{line:14,column:16},end:{line:14,column:17}},loc:{start:{line:14,column:24},end:{line:14,column:58}},line:14},"3":{name:"(anonymous_3)",decl:{start:{line:16,column:10},end:{line:16,column:11}},loc:{start:{line:17,column:6},end:{line:17,column:55}},line:17},"4":{name:"(anonymous_4)",decl:{start:{line:20,column:16},end:{line:20,column:17}},loc:{start:{line:20,column:36},end:{line:31,column:1}},line:20}},branchMap:{"0":{loc:{start:{line:22,column:16},end:{line:22,column:43}},type:"binary-expr",locations:[{start:{line:22,column:16},end:{line:22,column:26}},{start:{line:22,column:30},end:{line:22,column:43}}],line:22},"1":{loc:{start:{line:24,column:26},end:{line:25,column:85}},type:"binary-expr",locations:[{start:{line:24,column:26},end:{line:24,column:60}},{start:{line:25,column:7},end:{line:25,column:85}}],line:24},"2":{loc:{start:{line:27,column:2},end:{line:28,column:45}},type:"if",locations:[{start:{line:27,column:2},end:{line:28,column:45}},{start:{line:27,column:2},end:{line:28,column:45}}],line:27}},s:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0},f:{"0":0,"1":0,"2":0,"3":0,"4":0},b:{"0":[0,0],"1":[0,0],"2":[0,0]},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"86b369d48d1ab068549cbf0ddf36a0693e46d310"};var coverage=global[gcv]||(global[gcv]={});if(!coverage[path]||coverage[path].hash!==hash){coverage[path]=coverageData;}var actualCoverage=coverage[path];{// @ts-ignore
cov_2azy0hzo3d=function(){return actualCoverage;};}return actualCoverage;}cov_2azy0hzo3d();const{relative}=(cov_2azy0hzo3d().s[0]++,require('path'));const npa=(cov_2azy0hzo3d().s[1]++,require('npm-package-arg'));const pkgContents=(cov_2azy0hzo3d().s[2]++,require('@npmcli/installed-package-contents'));const pacote=(cov_2azy0hzo3d().s[3]++,require('pacote'));const{tarCreateOptions}=(cov_2azy0hzo3d().s[4]++,pacote.DirFetcher);const tar=(cov_2azy0hzo3d().s[5]++,require('tar'));// returns a simplified tarball when reading files from node_modules folder,
// thus avoiding running the prepare scripts and the extra logic from packlist
cov_2azy0hzo3d().s[6]++;const nodeModulesTarball=(manifest,opts)=>{cov_2azy0hzo3d().f[0]++;cov_2azy0hzo3d().s[7]++;return pkgContents({path:manifest._resolved,depth:1}).then(files=>{cov_2azy0hzo3d().f[1]++;cov_2azy0hzo3d().s[8]++;return files.map(file=>{cov_2azy0hzo3d().f[2]++;cov_2azy0hzo3d().s[9]++;return relative(manifest._resolved,file);});}).then(files=>{cov_2azy0hzo3d().f[3]++;cov_2azy0hzo3d().s[10]++;return tar.c(tarCreateOptions(manifest),files).concat();});};cov_2azy0hzo3d().s[11]++;const tarball=(manifest,opts)=>{cov_2azy0hzo3d().f[4]++;const resolved=(cov_2azy0hzo3d().s[12]++,manifest._resolved);const where=(cov_2azy0hzo3d().s[13]++,(cov_2azy0hzo3d().b[0][0]++,opts.where)||(cov_2azy0hzo3d().b[0][1]++,process.cwd()));const fromNodeModules=(cov_2azy0hzo3d().s[14]++,(cov_2azy0hzo3d().b[1][0]++,npa(resolved).type==='directory')&&(cov_2azy0hzo3d().b[1][1]++,/node_modules[\\/](@[^\\/]+\/)?[^\\/]+[\\/]?$/.test(relative(where,resolved))));cov_2azy0hzo3d().s[15]++;if(fromNodeModules){cov_2azy0hzo3d().b[2][0]++;cov_2azy0hzo3d().s[16]++;return nodeModulesTarball(manifest,opts);}else{cov_2azy0hzo3d().b[2][1]++;}cov_2azy0hzo3d().s[17]++;return pacote.tarball(manifest._resolved,opts);};cov_2azy0hzo3d().s[18]++;module.exports=tarball;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhcmJhbGwuanMiXSwibmFtZXMiOlsicmVsYXRpdmUiLCJyZXF1aXJlIiwibnBhIiwicGtnQ29udGVudHMiLCJwYWNvdGUiLCJ0YXJDcmVhdGVPcHRpb25zIiwiRGlyRmV0Y2hlciIsInRhciIsIm5vZGVNb2R1bGVzVGFyYmFsbCIsIm1hbmlmZXN0Iiwib3B0cyIsInBhdGgiLCJfcmVzb2x2ZWQiLCJkZXB0aCIsInRoZW4iLCJmaWxlcyIsIm1hcCIsImZpbGUiLCJjIiwiY29u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