From 67d0ef571d93f5ded2bb2cd60f1185ace4151f03 Mon Sep 17 00:00:00 2001 From: DevMirza <53424436+Zaid-maker@users.noreply.github.com> Date: Mon, 9 Oct 2023 21:39:55 +0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20lint=20warnings=20&=20err?= =?UTF-8?q?ors=20(#3862)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: lint warnings & errors * fix: lint warning * fix: lint warnings * Update user.js * Update util-server.js * Update server/util-server.js Co-authored-by: Nelson Chan <3271800+chakflying@users.noreply.github.com> * Update server/model/user.js Co-authored-by: Nelson Chan <3271800+chakflying@users.noreply.github.com> --------- Co-authored-by: Nelson Chan <3271800+chakflying@users.noreply.github.com> --- server/model/user.js | 6 +++--- server/server.js | 2 +- server/util-server.js | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/server/model/user.js b/server/model/user.js index d68f189ce..2dd3c51ed 100644 --- a/server/model/user.js +++ b/server/model/user.js @@ -31,9 +31,9 @@ class User extends BeanModel { /** * Create a new JWT for a user - * @param {User} user - * @param {string} jwtSecret - * @return {string} + * @param {User} user The User to create a JsonWebToken for + * @param {string} jwtSecret The key used to sign the JsonWebToken + * @returns {string} the JsonWebToken as a string */ static createJWT(user, jwtSecret) { return jwt.sign({ diff --git a/server/server.js b/server/server.js index c53755a6c..2b9bed170 100644 --- a/server/server.js +++ b/server/server.js @@ -81,7 +81,7 @@ const Monitor = require("./model/monitor"); const User = require("./model/user"); log.debug("server", "Importing Settings"); -const { getSettings, setSettings, setting, initJWTSecret, checkLogin, startUnitTest, FBSD, doubleCheckPassword, startE2eTests, shake256, SHAKE256_LENGTH, allowDevAllOrigin, +const { getSettings, setSettings, setting, initJWTSecret, checkLogin, FBSD, doubleCheckPassword, startE2eTests, shake256, SHAKE256_LENGTH, allowDevAllOrigin, } = require("./util-server"); log.debug("server", "Importing Notification"); diff --git a/server/util-server.js b/server/util-server.js index 06c77eb4e..5f47561c0 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -1066,10 +1066,9 @@ module.exports.grpcQuery = async (options) => { module.exports.SHAKE256_LENGTH = 16; /** - * - * @param {string} data - * @param {number} len - * @return {string} + * @param {string} data The data to be hashed + * @param {number} len Output length of the hash + * @returns {string} The hashed data in hex format */ module.exports.shake256 = (data, len) => { if (!data) {