2
1
mirror of https://github.com/Thream/socketio-jwt.git synced 2024-07-21 09:38:31 +02:00

build(deps-dev): bump typescript from 4.3.5 to 4.4.2 (#201)

Co-authored-by: Divlo <contact@divlo.fr>
This commit is contained in:
dependabot[bot] 2021-08-27 17:18:31 +02:00 committed by GitHub
parent 5a7d281798
commit 596d6a82c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 2234 additions and 2118 deletions

View File

@ -1,8 +0,0 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
rootDir: './src',
setupFilesAfterEnv: ['<rootDir>/__test__/setup.ts'],
collectCoverage: true,
coverageDirectory: '../coverage/'
}

7
jest.config.json Normal file
View File

@ -0,0 +1,7 @@
{
"preset": "ts-jest",
"testEnvironment": "node",
"rootDir": "./src",
"collectCoverage": true,
"coverageDirectory": "../coverage/"
}

4324
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -61,13 +61,13 @@
"@types/express": "4.17.13", "@types/express": "4.17.13",
"@types/jest": "27.0.1", "@types/jest": "27.0.1",
"@types/jsonwebtoken": "8.5.5", "@types/jsonwebtoken": "8.5.5",
"@types/node": "16.7.2", "@types/node": "16.7.3",
"@types/server-destroy": "1.0.1", "@types/server-destroy": "1.0.1",
"axios": "0.21.1", "axios": "0.21.1",
"editorconfig-checker": "4.0.2", "editorconfig-checker": "4.0.2",
"express": "4.17.1", "express": "4.17.1",
"husky": "7.0.2", "husky": "7.0.2",
"jest": "27.0.6", "jest": "27.1.0",
"markdownlint-cli": "0.28.1", "markdownlint-cli": "0.28.1",
"pinst": "2.1.6", "pinst": "2.1.6",
"rimraf": "3.0.2", "rimraf": "3.0.2",
@ -77,6 +77,6 @@
"socket.io-client": "4.1.3", "socket.io-client": "4.1.3",
"ts-jest": "27.0.5", "ts-jest": "27.0.5",
"ts-standard": "10.0.0", "ts-standard": "10.0.0",
"typescript": "4.3.5" "typescript": "4.4.2"
} }
} }

View File

@ -1 +0,0 @@
jest.setTimeout(15_000)

View File

@ -19,7 +19,7 @@ interface ExtendedSocket {
type SocketIOMiddleware = ( type SocketIOMiddleware = (
socket: Socket, socket: Socket,
next: (err?: ExtendedError) => void next: (error?: ExtendedError) => void
) => void ) => void
interface CompleteDecodedToken { interface CompleteDecodedToken {
@ -83,8 +83,8 @@ export const authorize = (options: AuthorizeOptions): SocketIOMiddleware => {
if (onAuthentication != null) { if (onAuthentication != null) {
try { try {
socket.user = await onAuthentication(decodedToken) socket.user = await onAuthentication(decodedToken)
} catch (err) { } catch (error: any) {
return next(err) return next(error)
} }
} }
return next() return next()