chore: resolve comment

This commit is contained in:
Vu Nguyen 2023-01-11 09:35:18 +07:00
parent 3deea91193
commit 9e34256b2f
1 changed files with 15 additions and 14 deletions

View File

@ -11,10 +11,11 @@ export const isValidUrl = (input: string) => {
}
}
export const downloadAndExtract = async (url: string): Promise<string> => new Promise((resolve, reject) => {
export const downloadAndExtract = async (url: string) =>
new Promise<string>((resolve, reject) => {
const destDir = `${tmpdir()}/chromium-pack`
const extractObj = extract(destDir)
get(url, function (response) {
get(url, (response) => {
response.pipe(extractObj);
extractObj.on('finish', () => {
extractObj.end(() => {