Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: node-fetch CVE-2022-0235 and reduce tech debt #214

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"trailingComma": "all",
"arrowParens": "avoid",
"endOfLine": "lf"
}
17 changes: 12 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
os: 'linux'
git:
autocrlf: input
language: node_js
node_js:
- '6'
- '14'
notifications:
email:
on_success: never
on_failure: never
jobs:
include:
- stage: "Tests"
name: Lint Test
script: npm run lint
- stage: 'Build and Test'
name: Format
script: npm run format:check
- script: npm run lint
name: Lint
- script: npm run build
name: Build Test
name: Build
- script: npm run test:unit
name: 'Unit Tests'
18,864 changes: 10,491 additions & 8,373 deletions lib/AvaTaxClient.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/utils/basic_auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*/

export function createBasicAuthHeader(account, licenseKey) {
const base64Encoded = new Buffer(`${account}:${licenseKey}`).toString(
'base64'
const base64Encoded = Buffer.from(`${account}:${licenseKey}`).toString(
'base64',
);
return `Basic ${base64Encoded}`;
}
10 changes: 5 additions & 5 deletions lib/utils/withTimeout.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export function withTimeout(msecs, promise) {
return new Promise((resolve, reject) => {
const timer = setTimeout(() => {
reject(new Error('timeout'))
}, msecs)
reject(new Error('timeout'));
}, msecs);

promise
.then(value => {
Expand All @@ -12,6 +12,6 @@ export function withTimeout(msecs, promise) {
.catch(reason => {
clearTimeout(timer);
reject(reason);
})
})
}
});
});
}
Loading