From 5bcd588b0f55a0e3f5ca6a19657b0f661aba6877 Mon Sep 17 00:00:00 2001 From: Fionn Date: Wed, 19 Apr 2023 22:25:38 +0200 Subject: [PATCH] auto formatting --- backend/src/app.ts | 2 +- backend/src/controllers/region.controller.ts | 2 +- backend/src/services/config.service.ts | 2 +- backend/src/services/regions.service.ts | 4 +- backend/src/services/wx.service.ts | 46 ++++++++++---------- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/backend/src/app.ts b/backend/src/app.ts index c962c46..1a42cd4 100644 --- a/backend/src/app.ts +++ b/backend/src/app.ts @@ -25,7 +25,7 @@ app.use((err, req: Request, res: Response, next: NextFunction) => { res.status(500).json({ msg: 'an error occurred' }); }); -nodesched.scheduleJob('regenerate data', '*/30 * * * * *', wxService.wrappedGenerateData) +nodesched.scheduleJob('regenerate data', '*/30 * * * * *', wxService.wrappedGenerateData); wxService.wrappedGenerateData(); const server = app.listen(PORT, () => { diff --git a/backend/src/controllers/region.controller.ts b/backend/src/controllers/region.controller.ts index 19a3fc1..c718144 100644 --- a/backend/src/controllers/region.controller.ts +++ b/backend/src/controllers/region.controller.ts @@ -15,7 +15,7 @@ export async function getRegion(req: express.Request, res: express.Response, nex const regionData = regionsService.getRegion(region); - if(!regionData) { + if (!regionData) { return next(); } diff --git a/backend/src/services/config.service.ts b/backend/src/services/config.service.ts index 94c7460..233e5b8 100644 --- a/backend/src/services/config.service.ts +++ b/backend/src/services/config.service.ts @@ -23,4 +23,4 @@ export function getConfig(): WxConfig { export default { getConfig, -} +}; diff --git a/backend/src/services/regions.service.ts b/backend/src/services/regions.service.ts index 4e15f8b..09b03f7 100644 --- a/backend/src/services/regions.service.ts +++ b/backend/src/services/regions.service.ts @@ -1,6 +1,6 @@ -import configService, { WxConfig, WxRegion } from "./config.service"; +import configService, { WxConfig, WxRegion } from './config.service'; -export function getRegions(): WxConfig["regions"] { +export function getRegions(): WxConfig['regions'] { return configService.getConfig().regions; } diff --git a/backend/src/services/wx.service.ts b/backend/src/services/wx.service.ts index 59e82b5..551b4d3 100644 --- a/backend/src/services/wx.service.ts +++ b/backend/src/services/wx.service.ts @@ -1,8 +1,8 @@ -import axios from "axios"; -import { WxFix } from "./config.service"; -import regionsService from "./regions.service"; +import axios from 'axios'; +import { WxFix } from './config.service'; +import regionsService from './regions.service'; -const cachedData: {[key: string]: WxData} = {}; +const cachedData: { [key: string]: WxData } = {}; const qnhLevelMapping = { 200: 390, @@ -12,7 +12,7 @@ const qnhLevelMapping = { 500: 180, 600: 140, 700: 100, - 850: 50 + 850: 50, }; const necessaryDatapoints = [ @@ -34,10 +34,10 @@ for (const qnh of Object.keys(qnhLevelMapping)) { } interface WxLevelData { - "T(K)": string; + 'T(K)': string; windspeed: string; windhdg: string; -}; +} export interface WxFixData { coords: { @@ -68,27 +68,27 @@ export async function getDataAtFix(fix: WxFix, index: number): Promise