From 2df7c4b068493785f2c2483a95c5722c4cfbdfb7 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 28 Sep 2023 21:48:27 +0100 Subject: [PATCH] Run Prettier Signed-off-by: Fred Boniface --- app.js | 2 +- src/services/find.services.ts | 5 ++++- src/services/issue.services.js | 10 ++++++---- src/utils/translators/ldb/staffStation.ts | 8 ++++++-- test/utils/sanitizer.utils.test.ts | 16 ++++++++++------ 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/app.js b/app.js index ede9f7b..6d97d06 100644 --- a/app.js +++ b/app.js @@ -19,7 +19,7 @@ const cors = require("cors"); const authenticate = require("./src/middlewares/auth.middlewares"); // Internal Requires -const version = require("./src/configs/version.configs");/* +const version = require("./src/configs/version.configs"); /* const listRtr = require("./src/routes/list.routes"); const ldbRtr = require("./src/routes/ldb.routes"); const ldbsRtr = require("./src/routes/ldbs.routes"); diff --git a/src/services/find.services.ts b/src/services/find.services.ts index 5f1f2ac..1e98fe2 100644 --- a/src/services/find.services.ts +++ b/src/services/find.services.ts @@ -1,7 +1,10 @@ // Parse and return a find request import { query } from "../services/dbAccess.services"; -import { cleanApiEndpointTxt, cleanApiEndpointNum } from "../utils/sanitizer.utils"; +import { + cleanApiEndpointTxt, + cleanApiEndpointNum, +} from "../utils/sanitizer.utils"; import { logger } from "../utils/logger.utils"; // Define collection as all queries are for the "corpus" collection. diff --git a/src/services/issue.services.js b/src/services/issue.services.js index 32e50ae..302eeae 100644 --- a/src/services/issue.services.js +++ b/src/services/issue.services.js @@ -35,14 +35,16 @@ async function sendToGitea(body) { if (res.status === 201) { logger.debug("issueService.sendToGitea: Issue created"); - return {status: res.status, message: "issue created"}; + return { status: res.status, message: "issue created" }; } else { - logger.error(`issueService.sendtoGitea: Error creating issue RETURN: ${res.status}`); - return {status: res.status, message: "issue not created"}; + logger.error( + `issueService.sendtoGitea: Error creating issue RETURN: ${res.status}` + ); + return { status: res.status, message: "issue not created" }; } } catch (err) { logger.error(err, `issueService.sendToGitea`); - return {status:500, message: "Internal Server Error"}; + return { status: 500, message: "Internal Server Error" }; } } diff --git a/src/utils/translators/ldb/staffStation.ts b/src/utils/translators/ldb/staffStation.ts index 29970ea..bc206c4 100644 --- a/src/utils/translators/ldb/staffStation.ts +++ b/src/utils/translators/ldb/staffStation.ts @@ -65,7 +65,9 @@ function transformNrcc(input: any): NrccMessage[] | undefined { } function transformTrainServices(input: any): TrainServices[] { - logger.trace("utils/translators/ldb/staffLdb.transformTrainServices: Running"); + logger.trace( + "utils/translators/ldb/staffLdb.transformTrainServices: Running" + ); let services: any = input?.service; let output: TrainServices[] = []; if (services === undefined) { @@ -150,7 +152,9 @@ export function calculateLength(input: any): number | undefined { } function transformUnspecifiedDateTime(input: string): Date | undefined { - logger.trace("utils/translators/ldb/staffStation.transformUnspecifiedDateTime: Running"); + logger.trace( + "utils/translators/ldb/staffStation.transformUnspecifiedDateTime: Running" + ); if (!input) { return undefined; } diff --git a/test/utils/sanitizer.utils.test.ts b/test/utils/sanitizer.utils.test.ts index 6ed8858..7a3b89a 100644 --- a/test/utils/sanitizer.utils.test.ts +++ b/test/utils/sanitizer.utils.test.ts @@ -41,18 +41,22 @@ describe("Remove non-Alpha", () => { const desired = outputs[key]; test(`Should return with only letters: ${key}`, () => { expect(removeNonAlpha(input)).toEqual(desired); - }) + }); } -}) +}); describe("Remove non-alphanumeric", () => { - const inputs = ["DROP/*comment*/sampletable", "10; DROP TABLE members /*", "1F44"]; + const inputs = [ + "DROP/*comment*/sampletable", + "10; DROP TABLE members /*", + "1F44", + ]; const outputs = ["DROPcommentsampletable", "10DROPTABLEmembers", "1F44"]; for (const key in inputs) { const input = inputs[key]; const desired = outputs[key]; test(`Should return with only alphanumeric: ${key}`, () => { expect(removeNonAlphanumeric(input)).toEqual(desired); - }) - } -}) \ No newline at end of file + }); + } +});