diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 9ae7956..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - env: { - node: true, - commonjs: true, - es2021: true, - }, - extends: "eslint:recommended", - parserOptions: { - ecmaVersion: 12, - }, - rules: {}, -}; diff --git a/src/db/utils.ts b/src/db/utils.ts index 6e5f3d3..552463d 100644 --- a/src/db/utils.ts +++ b/src/db/utils.ts @@ -9,7 +9,7 @@ export function addContact( ): void { User.findOne({ where: { telegram: userATelegram } }).then((userA) => { User.findOne({ where: { id: userBRowID } }).then((userB) => { - if (!!userA || !!userB) { + if (!userA || !userB) { done(false, "Could not find user."); return; } diff --git a/src/routes/CodeRoute.ts b/src/routes/CodeRoute.ts index 9f435b4..aee5b49 100644 --- a/src/routes/CodeRoute.ts +++ b/src/routes/CodeRoute.ts @@ -21,7 +21,7 @@ export function CodeRoute(req: Request, res: Response) { function createQRCode( telegram: TelegramID, - callback: (errorMessage: string, url?: string) => void + callback: (errorMessage: string | Error, url?: string) => void ): void { User.findOne({ where: { @@ -38,7 +38,7 @@ function createQRCode( verifyURL, { width: 300, height: 300 } as QRCodeToDataURLOptions, (error, url) => { - callback(error.message, url); + callback(error, url); } ); }); diff --git a/src/routes/VerifyRoute.ts b/src/routes/VerifyRoute.ts index 43295f3..8a3b47b 100644 --- a/src/routes/VerifyRoute.ts +++ b/src/routes/VerifyRoute.ts @@ -45,6 +45,4 @@ function checkVerification( callback(false, "No such verification"); } }); -} - -exports.VerifyRoute = VerifyRoute; +} \ No newline at end of file