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(deps): upgrade axios and typescript #288

Merged
merged 4 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/apisauce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const CANCEL_ERROR = 'CANCEL_ERROR'

const TIMEOUT_ERROR_CODES = ['ECONNABORTED']
const NODEJS_CONNECTION_ERROR_CODES = ['ENOTFOUND', 'ECONNREFUSED', 'ECONNRESET']
const STATUS_ERROR_CODES = ['ERR_BAD_REQUEST', 'ERR_BAD_RESPONSE']
const in200s = (n: number): boolean => isWithin(200, 299, n)
const in400s = (n: number): boolean => isWithin(400, 499, n)
const in500s = (n: number): boolean => isWithin(500, 599, n)
Expand All @@ -84,6 +85,7 @@ export const getProblemFromError = error => {

// then check the specific error code
if (!error.code) return getProblemFromStatus(error.response ? error.response.status : null)
if (STATUS_ERROR_CODES.includes(error.code)) return getProblemFromStatus(error.response.status)
if (TIMEOUT_ERROR_CODES.includes(error.code)) return TIMEOUT_ERROR
if (NODEJS_CONNECTION_ERROR_CODES.includes(error.code)) return CONNECTION_ERROR
return UNKNOWN_ERROR
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]
},
"dependencies": {
"axios": "^0.21.4"
"axios": "^0.27.2"
},
"description": "Axios + standardized errors + request/response transforms.",
"devDependencies": {
Expand Down Expand Up @@ -41,7 +41,7 @@
"tslint": "^5.12.0",
"tslint-config-prettier": "^1.17.0",
"tslint-config-standard": "^8.0.1",
"typescript": "3.2.1"
"typescript": "3.5.1"
},
"files": [
"dist/apisauce.js",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"target": "es5",
"module": "es2015",
"strict": false,
"lib": ["es2015"]
"lib": ["dom", "es2015"]
},
"include": ["lib"]
}