From b49b2221d7dd4abefaeb4a996fa8c5d37a32b4f3 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 30 Nov 2023 14:33:57 +0000 Subject: [PATCH] Update @owlboard/ts-types --- package-lock.json | 8 ++++---- ...{trainService.services.js => trainService.services.ts} | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) rename src/services/{trainService.services.js => trainService.services.ts} (96%) diff --git a/package-lock.json b/package-lock.json index 135263b..16ec17e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "zlib": "^1.0.5" }, "devDependencies": { - "@owlboard/ts-types": "^0.1.0", + "@owlboard/ts-types": "^0.1.3", "@types/jest": "^29.5.3", "eslint": "^8.39.0", "jest": "^29.6.2", @@ -1983,9 +1983,9 @@ } }, "node_modules/@owlboard/ts-types": { - "version": "0.1.0", - "resolved": "https://git.fjla.uk/api/packages/OwlBoard/npm/%40owlboard%2Fts-types/-/0.1.0/ts-types-0.1.0.tgz", - "integrity": "sha512-5dLkm1wEimiv+pr5wuJbJvPfSek9WuApl/4SBwoFXVO2bmAIktFIHi+bznXKnhW9a7nJwX/w+bVwwJpBOI3I1g==", + "version": "0.1.3", + "resolved": "https://git.fjla.uk/api/packages/OwlBoard/npm/%40owlboard%2Fts-types/-/0.1.3/ts-types-0.1.3.tgz", + "integrity": "sha512-BKi/tWvA0SN2rgt2GnFnSXEXzG3DNjeTm0ojVuMElnok9MJ9IniTXRjdAdjm+fe5ShebH6EKacO5f1MDAD3qJw==", "dev": true, "license": "GPL-3.0-or-later" }, diff --git a/src/services/trainService.services.js b/src/services/trainService.services.ts similarity index 96% rename from src/services/trainService.services.js rename to src/services/trainService.services.ts index 82a6014..647b9b3 100644 --- a/src/services/trainService.services.js +++ b/src/services/trainService.services.ts @@ -6,7 +6,7 @@ import { logger } from "../utils/logger.utils"; // This function is deprecated and should no longer be used. // It will be removed in a later version -async function findByHeadcodeToday(headcode) { +async function findByHeadcodeToday(headcode: string) { const sanitizedHeadcode = clean.removeNonAlphanumeric(headcode).toUpperCase(); logger.debug( `trainServiceServices.findByHeadcode: Searching for headcode ${sanitizedHeadcode}` @@ -42,7 +42,7 @@ async function findByHeadcodeToday(headcode) { } // Finds a train by its headcode value -async function findByHeadcode(date, headcode) { +async function findByHeadcode(date: string | Date, headcode: string) { const sanitizedHeadcode = clean.removeNonAlphanumeric(headcode).toUpperCase(); logger.debug( `trainServiceServices.findByHeadcode: Searching for headcode ${sanitizedHeadcode}` @@ -86,7 +86,7 @@ async function findByHeadcode(date, headcode) { } // Finds a train by its trainUid value -async function findByTrainUid(uid, date = new Date()) { +async function findByTrainUid(uid: string, date: Date | string = new Date()) { let queryDate; if (date === "now") { queryDate = new Date();