From 5ae128bcf4234e348394db708eec2d989616d94c Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Tue, 21 Nov 2023 12:56:50 -0500 Subject: [PATCH] fix(striker-ui-api): use ctor to handle number configs --- striker-ui-api/src/lib/consts/ENV.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/striker-ui-api/src/lib/consts/ENV.ts b/striker-ui-api/src/lib/consts/ENV.ts index 908afb98..dd7fa2dd 100644 --- a/striker-ui-api/src/lib/consts/ENV.ts +++ b/striker-ui-api/src/lib/consts/ENV.ts @@ -12,7 +12,7 @@ export const COOKIE_PREFIX = process.env.COOKIE_PREFIX ?? 'suiapi'; * * @default 28800000 */ -export const COOKIE_ORIGINAL_MAX_AGE = +export const COOKIE_ORIGINAL_MAX_AGE: number = Number(process.env.COOKIE_ORIGINAL_MAX_AGE) || 28800000; /** @@ -22,16 +22,15 @@ export const COOKIE_ORIGINAL_MAX_AGE = * * @default 0 */ -export const DEFAULT_JOB_PROGRESS: number = Number.parseInt( - process.env.DEFAULT_JOB_PROGRESS ?? '0', -); +export const DEFAULT_JOB_PROGRESS: number = + Number(process.env.DEFAULT_JOB_PROGRESS) || 0; /** * Port to use by the express app. * * @default 8080 */ -export const PORT = Number.parseInt(process.env.PORT ?? '8080'); +export const PORT: number = Number(process.env.PORT) || 8080; /** * Process user identifier. Also used to set ownership on the access daemon.