1
mirror of https://github.com/jakejarvis/careful-downloader.git synced 2025-04-26 07:45:23 -04:00

fix node 12.x

This commit is contained in:
Jake Jarvis 2021-10-06 09:57:34 -04:00
parent b75aef6e80
commit 3325d61b62
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
3 changed files with 4 additions and 6 deletions

View File

@ -29,5 +29,4 @@ jobs:
node-version: ${{ matrix.node }}
- run: yarn install --frozen-lockfile
- run: yarn audit
- run: yarn lint
- run: yarn test

View File

@ -11,13 +11,13 @@ import urlParse from "url-parse";
export default async function downloader(downloadUrl, checksumUrl, options) {
// normalize options and set defaults
options = {
filename: options.filename ?? urlParse(downloadUrl).pathname.split("/").pop(),
filename: options.filename || urlParse(downloadUrl).pathname.split("/").pop(),
extract: !!options.extract,
tempDir: options.tempDir ? path.resolve(process.cwd(), options.tempDir) : tempy.directory(),
destDir: options.destDir ? path.resolve(process.cwd(), options.destDir) : path.resolve(process.cwd(), "download"),
cleanDestDir: !!options.cleanDestDir,
algorithm: options.algorithm ?? "sha256",
encoding: options.encoding ?? "binary",
algorithm: options.algorithm || "sha256",
encoding: options.encoding || "binary",
};
try {

View File

@ -21,8 +21,7 @@
"index.d.ts"
],
"scripts": {
"lint": "eslint .",
"test": "mocha"
"test": "eslint . && mocha"
},
"dependencies": {
"decompress": "^4.2.1",