From daa97c261a8b23dbd7cd61bc3a377f7cc782e576 Mon Sep 17 00:00:00 2001 From: Josh Cunningham Date: Fri, 15 Dec 2023 12:11:51 -0800 Subject: [PATCH] fix: broken config tests --- src/utils/config.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/utils/config.ts b/src/utils/config.ts index 9139ba8..828a8df 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -91,12 +91,14 @@ export const getConfiguration = (): Configuration => { } if (typeof mergedConfig.outputFile === "object") { - const reportYear = - (year as string) || date - ? (date as string).split("-")[0] - : new Date().getFullYear(); - - return mergedConfig.outputFile[reportYear]; + let reportYear = (new Date().getFullYear()).toString(); + if (year) { + reportYear = (year as string); + } else if (date) { + reportYear = (date as string).split("-")[0]; + } + + return mergedConfig.outputFile[reportYear] || defaultConfig.outputFile; } return defaultConfig.outputFile;