From 3325d61b62450e7ce8498233b26cfa9182c33874 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Wed, 6 Oct 2021 09:57:34 -0400 Subject: [PATCH] fix node 12.x --- .github/workflows/ci.yml | 1 - index.js | 6 +++--- package.json | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d924862..0fe031b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,5 +29,4 @@ jobs: node-version: ${{ matrix.node }} - run: yarn install --frozen-lockfile - run: yarn audit - - run: yarn lint - run: yarn test diff --git a/index.js b/index.js index cb70991..9b6b3c0 100644 --- a/index.js +++ b/index.js @@ -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 { diff --git a/package.json b/package.json index d572f30..4357322 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,7 @@ "index.d.ts" ], "scripts": { - "lint": "eslint .", - "test": "mocha" + "test": "eslint . && mocha" }, "dependencies": { "decompress": "^4.2.1",