Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20]
node: [20, 22, 24]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Cache node_modules
uses: actions/cache@v3
uses: actions/cache@v5
env:
cache-name: cache-node-modules
with:
Expand All @@ -26,7 +26,7 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
check-latest: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 18
node-version: 20
check-latest: true
registry-url: https://registry.npmjs.org/
- run: npm publish --access public
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v6
with:
node-version: 18
node-version: 20
check-latest: true
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
Expand Down
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint
npm run lint
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.18.2
20.0.0
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"build:ci": "npm i --include=dev && tsc",
"docs": "typedoc",
"prepublishOnly": "npm run build:ci",
"lint": "eslint src/**/*.ts",
"lint:ci": "eslint --output-file eslint_report.json --format json src/**/*.ts",
"prepare": "npx husky install"
"lint": "eslint",
"lint:ci": "eslint --output-file eslint_report.json --format json",
"prepare": "npx husky init"
},
"repository": {
"type": "git",
Expand All @@ -25,26 +25,26 @@
},
"homepage": "https://topgg.js.org",
"devDependencies": {
"@types/express": "^4.17.17",
"@types/jest": "^29.5.4",
"@types/node": "^20.5.9",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^27.2.3",
"express": "^4.18.2",
"husky": "^8.0.3",
"jest": "^29.6.4",
"lint-staged": "^14.0.1",
"prettier": "^3.0.3",
"ts-jest": "^29.1.1",
"typedoc": "^0.25.1",
"typescript": "^5.2.2"
"@types/express": "^5.0.6",
"@types/jest": "^30.0.0",
"@types/node": "^25.2.0",
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-jest": "^29.12.1",
"express": "^5.2.1",
"husky": "^9.1.7",
"jest": "^30.2.0",
"lint-staged": "^16.2.7",
"prettier": "^3.8.1",
"ts-jest": "^29.4.6",
"typedoc": "^0.28.16",
"typescript": "^5.9.3"
},
"dependencies": {
"raw-body": "^2.5.2",
"undici": "^5.23.0"
"raw-body": "^3.0.2",
"undici": "^7.20.0"
},
"types": "./dist/index.d.ts"
}
1 change: 1 addition & 0 deletions src/structs/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class Api extends EventEmitter {
const tokenData = atob(tokenSegments[1]);

try {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
JSON.parse(tokenData).id;
} catch {
throw new Error(
Expand Down
2 changes: 1 addition & 1 deletion src/structs/Webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class Webhook {
const parsed = JSON.parse(body.toString("utf8"));

resolve(this._formatIncoming(parsed));
} catch (err) {
} catch {
res.status(400).json({ error: "Invalid body" });
resolve(false);
}
Expand Down