mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore(deps): update extract-zip to version 2 (#5610)
extract-zip removed support for callbacks and instead uses promises. Moreover, it has TypeScript support which allows us to remove the @types/extract-zip package. This update allows downstream users to remove their installation of mkdirp, which uses a vulnerable version of minimist. For more info, see https://github.com/maxogden/extract-zip/releases/tag/v2.0.0 Co-authored-by: Mathias Bynens <mathias@qiwi.be>
This commit is contained in:
parent
0bcc5a7ad8
commit
1ce4fe7169
@ -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 (error) {
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
function httpRequest(url, method, response) {
|
||||
|
@ -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",
|
||||
@ -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",
|
||||
|
@ -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 (error) {
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,7 +3,8 @@
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"outDir": "./lib",
|
||||
"target": "ESNext"
|
||||
"target": "ESNext",
|
||||
"moduleResolution": "node"
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
|
Loading…
Reference in New Issue
Block a user