Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function(fd, cb){
var foundPlist = false;
cb = once(cb || function(){});
fromFd(fd, function(err, zip){
if (err) return cb(err);
var onentry;
zip.on('entry', onentry = function(entry){
if (!reg.test(entry.fileName)) {
return
} else {
foundPlist = true
}
zip.removeListener('entry', onentry);
zip.openReadStream(entry, function(err, file){
if (err) return cb(err);
collect(file, function(err, src){
if (err) return cb(err);
return new Promise((resolve, reject) => {
fromFd(target, options, (err, zipfile) => {
if (err) { reject(err); } else { resolve(zipfile); }
});
});
}