土讃線問題の対策

This commit is contained in:
harukin-OneMix4
2023-07-07 00:07:32 +09:00
parent eb806e3f8a
commit d3c9bca4d3
3 changed files with 14 additions and 9 deletions

View File

@@ -0,0 +1,6 @@
export const checkDuplicateTrainData = (currentTrainArray) => {
const notNyujoData = currentTrainArray.filter((d) => d.delay !== "入線");
if (currentTrainArray.length == 1) return currentTrainArray[0];
if (notNyujoData.length == 0) return currentTrainArray[0];
else return notNyujoData[0];
};