From be1495d8b368fbee4750a502286a2b3ac1c4e6d4 Mon Sep 17 00:00:00 2001 From: "Peter.Morton" Date: Thu, 12 Oct 2023 19:01:11 -0500 Subject: [PATCH] format --- src/api/routes/auth.js | 5 +++-- src/api/routes/interactions-flow.js | 3 ++- src/utils/index.js | 12 ++++++------ src/utils/store.js | 12 ++++++------ 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/api/routes/auth.js b/src/api/routes/auth.js index cbd4a1d..4513d78 100644 --- a/src/api/routes/auth.js +++ b/src/api/routes/auth.js @@ -89,9 +89,10 @@ router.all("/", (req, res, next) => { }) .then(() => { res.send(decoded); - }).catch((e) => { + }) + .catch((e) => { logger.error(e); // "Uh-oh!" - });; + }); } catch (err) { logger.error(`Verify failed [${JSON.stringify(err, null, 2)}].`); next(err); diff --git a/src/api/routes/interactions-flow.js b/src/api/routes/interactions-flow.js index 46604ed..d9830da 100644 --- a/src/api/routes/interactions-flow.js +++ b/src/api/routes/interactions-flow.js @@ -134,7 +134,8 @@ router.get("/", async (req, res) => { logger.debug(`Sending data: ${JSON.stringify(data, null, 2)}`); res.send(data); - }).catch((e) => { + }) + .catch((e) => { logger.error(e); // "Uh-oh!" }); }); diff --git a/src/utils/index.js b/src/utils/index.js index fe0fde4..a986a9d 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,11 +1,11 @@ export { default as logger } from "./logger.js"; export { default as store } from "./store.js"; export function isEmpty(obj) { - for (const prop in obj) { - if (Object.hasOwn(obj, prop)) { - return false; - } + for (const prop in obj) { + if (Object.hasOwn(obj, prop)) { + return false; } - - return true; } + + return true; +} diff --git a/src/utils/store.js b/src/utils/store.js index 1f4555d..1cc7033 100644 --- a/src/utils/store.js +++ b/src/utils/store.js @@ -1,14 +1,14 @@ -import { createClient } from 'redis'; +import { createClient } from "redis"; import config from "../config/index.js"; import { logger } from "./index.js"; const client = createClient({ - url: config.redis.url - }); + url: config.redis.url, +}); -client.on('error', err => logger.error('Redis Client Error', err)); +client.on("error", (err) => logger.error("Redis Client Error", err)); await client.connect(); -logger.info(`Connect store to ${config.redis.url}`) +logger.info(`Connect store to ${config.redis.url}`); -export default client; \ No newline at end of file +export default client;