1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

Fix lint errors.

This commit is contained in:
Pedro Gutiérrez 2019-04-09 13:16:39 +02:00 committed by Pedro Gutiérrez
parent ddaf583ba0
commit 78ab06bf9a

View File

@ -136,19 +136,19 @@ export class Brizo extends Instantiable {
.getConnector()
.get(url)
const filename = response.headers.get('content-disposition').match(/attachment;filename=(.+)/)[1]
const filename = response.headers.get("content-disposition").match(/attachment;filename=(.+)/)[1]
await new Promise(async (resolve, reject) => {
fs.mkdirSync(destination, {recursive: true})
const fileStream = fs.createWriteStream(`${destination}${filename}`);
response.body.pipe(fileStream);
response.body.on("error", reject);
fileStream.on("finish", resolve);
});
const fileStream = fs.createWriteStream(`${destination}${filename}`)
response.body.pipe(fileStream)
response.body.on("error", reject)
fileStream.on("finish", resolve)
})
return destination
} else {
window.open(url, '_blank')
window.open(url, "_blank")
}
}
}