Skip to content

Commit

Permalink
fix: broken config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed Dec 15, 2023
1 parent f46f91f commit daa97c2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit daa97c2

Please sign in to comment.