From 9434ee24dfa31548c3a0236ca608dda027a7b4af Mon Sep 17 00:00:00 2001 From: TheRealBarenziah <> Date: Sun, 29 May 2022 17:35:13 +0200 Subject: [PATCH] chore: code sanity ++ - remove useless axios devDep - Expression 'customPayload' always passes null check at this point because it is already checked at line 30 (in postToChevereto) --- package-lock.json | 49 ++---------------------------------------- package.json | 1 - src/postToChevereto.ts | 2 +- 3 files changed, 3 insertions(+), 49 deletions(-) diff --git a/package-lock.json b/package-lock.json index 76cbe19..fc76096 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "imgbb-uploader", - "version": "1.4.0", + "version": "1.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "imgbb-uploader", - "version": "1.4.0", + "version": "1.5.0", "license": "SEE LICENSE IN TARGARYEN_UNLICENSE", "devDependencies": { "@babel/core": "^7.18.2", @@ -17,7 +17,6 @@ "@types/node": "^14.0.27", "@typescript-eslint/eslint-plugin": "^5.26.0", "@typescript-eslint/parser": "^5.26.0", - "axios": "^0.21.4", "babel-jest": "^28.1.0", "dotenv": "^8.2.0", "eslint": "^8.16.0", @@ -3644,15 +3643,6 @@ "node": ">=8" } }, - "node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, "node_modules/babel-jest": { "version": "28.1.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-28.1.0.tgz", @@ -5420,26 +5410,6 @@ "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", "dev": true }, - "node_modules/follow-redirects": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -12839,15 +12809,6 @@ "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", "dev": true }, - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, - "requires": { - "follow-redirects": "^1.14.0" - } - }, "babel-jest": { "version": "28.1.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-28.1.0.tgz", @@ -14196,12 +14157,6 @@ "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", "dev": true }, - "follow-redirects": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", - "dev": true - }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", diff --git a/package.json b/package.json index fe6b717..7ec683a 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "@types/node": "^14.0.27", "@typescript-eslint/eslint-plugin": "^5.26.0", "@typescript-eslint/parser": "^5.26.0", - "axios": "^0.21.4", "babel-jest": "^28.1.0", "dotenv": "^8.2.0", "eslint": "^8.16.0", diff --git a/src/postToChevereto.ts b/src/postToChevereto.ts index 02b57f6..a5370ee 100644 --- a/src/postToChevereto.ts +++ b/src/postToChevereto.ts @@ -28,7 +28,7 @@ export const postToChevereto = (params: IPostParams) => // Throw instantly when 'txt' or 'redirect' is passed to customPayload.format.. We don't do that here if (customPayload) { - if (customPayload?.format === "txt" || customPayload?.format === "redirect") { + if (customPayload.format === "txt" || customPayload.format === "redirect") { throw new Error( "'options.customPayload.format' standard alternatives to 'json' are not supported; see USE_WITH_CHEVERETO.md for more details.", );