Skip to content

Commit bd9d2b9

Browse files
committed
fix: script
1 parent a145cb4 commit bd9d2b9

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

scripts/station-check.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,14 @@ function validateRecords(records: StationRecord[]): { valid: boolean; errors: st
193193
errors.push(`第 ${lineNum} 行: floor 必須是正整數,當前值: ${record.floor}`);
194194
}
195195

196-
// 檢查 8: net 1 || 2 || 3 三選一
197-
if (record.net !== '1' && record.net !== '2' && record.net !== '3') {
198-
errors.push(`第 ${lineNum} 行: net 必須是 1、2 或 3,當前值: ${record.net}`);
196+
// 檢查 8: net 1 || 2 || 3 || 4 四選一
197+
if (record.net !== '1' && record.net !== '2' && record.net !== '3' && record.net !== '4') {
198+
errors.push(`第 ${lineNum} 行: net 必須是 1、2、3 或 4,當前值: ${record.net}`);
199+
}
200+
201+
// 檢查 10: net 為 3 或 4 時,id 開頭必須為 1
202+
if ((record.net === '3' || record.net === '4') && !record.id.startsWith('1')) {
203+
errors.push(`第 ${lineNum} 行: net 為 ${record.net} 時,id 開頭必須為 1,當前 id: ${record.id}`);
199204
}
200205

201206
// 檢查 9: work 必須是 0 或 1

0 commit comments

Comments
 (0)