diff --git a/lib/getTrainDelayStatus.ts b/lib/getTrainDelayStatus.ts index 5dd722f..af7e163 100644 --- a/lib/getTrainDelayStatus.ts +++ b/lib/getTrainDelayStatus.ts @@ -1,7 +1,7 @@ type getTrainDelayStatus = ( - current: { delay: string; Pos: string }, + current: { delay: number | "入線" | string; Pos: string }, Station_JP: string -) => string; +) => string | number; export const getTrainDelayStatus: getTrainDelayStatus = ( current, Station_JP @@ -17,7 +17,7 @@ export const getTrainDelayStatus: getTrainDelayStatus = ( } case Number.isNaN(delay): return delay; - case delay === "0": + case delay === 0: return "定刻通り"; default: return delay + "分遅れ";