refactor: fix types

This commit is contained in:
syuilo 2022-02-13 12:46:52 +09:00
parent 51aad804d6
commit 93cb26e879
1 changed files with 4 additions and 4 deletions

View File

@ -266,7 +266,7 @@ export default abstract class Chart<T extends Schema> {
const currentLog = await repository.findOne({
date: Chart.dateToTimestamp(current),
...(group ? { group: group } : {}),
}) as RawRecord<T>;
}) as RawRecord<T> | undefined;
// ログがあればそれを返して終了
if (currentLog != null) {
@ -306,7 +306,7 @@ export default abstract class Chart<T extends Schema> {
const currentLog = await repository.findOne({
date: date,
...(group ? { group: group } : {}),
}) as RawRecord<T>;
}) as RawRecord<T> | undefined;
// ログがあればそれを返して終了
if (currentLog != null) return currentLog;
@ -576,7 +576,7 @@ export default abstract class Chart<T extends Schema> {
order: {
date: -1,
},
}) as RawRecord<T>;
}) as RawRecord<T> | undefined;
if (recentLog) {
logs = [recentLog];
@ -593,7 +593,7 @@ export default abstract class Chart<T extends Schema> {
order: {
date: -1,
},
}) as RawRecord<T>;
}) as RawRecord<T> | undefined;
if (outdatedLog) {
logs.push(outdatedLog);