Skip to content

Commit daa97c2

Browse files
committed
fix: broken config tests
1 parent f46f91f commit daa97c2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/utils/config.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,14 @@ export const getConfiguration = (): Configuration => {
9191
}
9292

9393
if (typeof mergedConfig.outputFile === "object") {
94-
const reportYear =
95-
(year as string) || date
96-
? (date as string).split("-")[0]
97-
: new Date().getFullYear();
98-
99-
return mergedConfig.outputFile[reportYear];
94+
let reportYear = (new Date().getFullYear()).toString();
95+
if (year) {
96+
reportYear = (year as string);
97+
} else if (date) {
98+
reportYear = (date as string).split("-")[0];
99+
}
100+
101+
return mergedConfig.outputFile[reportYear] || defaultConfig.outputFile;
100102
}
101103

102104
return defaultConfig.outputFile;

0 commit comments

Comments
 (0)