Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update extract-zip to version 2 #5610

Merged
merged 5 commits into from Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 6 additions & 7 deletions experimental/puppeteer-firefox/lib/BrowserFetcher.js
Expand Up @@ -289,13 +289,12 @@ function downloadFile(url, destinationPath, progressCallback) {
* @param {string} folderPath
* @return {!Promise<?Error>}
*/
function extractZip(zipPath, folderPath) {
return new Promise((fulfill, reject) => extract(zipPath, {dir: folderPath}, err => {
if (err)
reject(err);
else
fulfill();
}));
async function extractZip(zipPath, folderPath) {
try {
await extract(zipPath, {dir: folderPath});
} catch (e) {
return e;
mathiasbynens marked this conversation as resolved.
Show resolved Hide resolved
}
}

function httpRequest(url, method, response) {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"@types/mime-types": "^2.1.0",
"debug": "^4.1.0",
"extract-zip": "^1.6.6",
"extract-zip": "^2.0.0",
"https-proxy-agent": "^4.0.0",
"mime": "^2.0.3",
"mime-types": "^2.1.25",
Expand All @@ -48,7 +48,6 @@
},
"devDependencies": {
"@types/debug": "0.0.31",
"@types/extract-zip": "^1.6.2",
"@types/mime": "^2.0.0",
"@types/node": "^10.17.14",
"@types/rimraf": "^2.0.2",
Expand Down
13 changes: 6 additions & 7 deletions src/BrowserFetcher.js
Expand Up @@ -334,13 +334,12 @@ function install(archivePath, folderPath) {
* @param {string} folderPath
* @return {!Promise<?Error>}
*/
function extractZip(zipPath, folderPath) {
return new Promise((fulfill, reject) => extract(zipPath, {dir: folderPath}, err => {
if (err)
reject(err);
else
fulfill();
}));
async function extractZip(zipPath, folderPath) {
try {
await extract(zipPath, {dir: folderPath});
} catch (e) {
return e;
mathiasbynens marked this conversation as resolved.
Show resolved Hide resolved
}
}

/**
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Expand Up @@ -3,7 +3,8 @@
"allowJs": true,
"checkJs": true,
"outDir": "./lib",
"target": "ESNext"
"target": "ESNext",
"moduleResolution": "node"
},
"include": [
"src"
Expand Down