getStringConfigを移動
This commit is contained in:
60
lib/getStringConfig.ts
Normal file
60
lib/getStringConfig.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
type typeID =
|
||||
| "Normal"
|
||||
| "OneMan"
|
||||
| "Rapid"
|
||||
| "OneManRapid"
|
||||
| "LTDEXP"
|
||||
| "NightLTDEXP"
|
||||
| "SPCL"
|
||||
| "SPCL_Normal"
|
||||
| "SPCL_Rapid"
|
||||
| "SPCL_EXP"
|
||||
| "Freight"
|
||||
| "Forwarding"
|
||||
| "FreightForwarding"
|
||||
| "Other";
|
||||
type types = (types: typeID, id: string) => [string, boolean, boolean];
|
||||
export const getStringConfig: types = (type, id) => {
|
||||
switch (type) {
|
||||
case "Normal":
|
||||
return ["普通", true, false];
|
||||
case "OneMan":
|
||||
return ["普通", true, true];
|
||||
case "Rapid":
|
||||
return ["快速", true, false];
|
||||
case "OneManRapid":
|
||||
return ["快速", true, true];
|
||||
case "LTDEXP":
|
||||
return ["特急", true, false];
|
||||
case "NightLTDEXP":
|
||||
return ["特急", true, false];
|
||||
case "SPCL":
|
||||
return ["臨時", true, false];
|
||||
case "SPCL_Normal":
|
||||
return ["臨時", true, false];
|
||||
case "SPCL_Rapid":
|
||||
return ["臨時快速", true, false];
|
||||
case "SPCL_EXP":
|
||||
return ["臨時特急", true, false];
|
||||
case "Freight":
|
||||
return ["貨物", false, false];
|
||||
case "Forwarding":
|
||||
return ["回送", false, false];
|
||||
case "FreightForwarding":
|
||||
return ["単機回送", false, false];
|
||||
case "Other":
|
||||
switch (true) {
|
||||
case !!id.includes("T"):
|
||||
return ["単機回送", false, false];
|
||||
case !!id.includes("R"):
|
||||
case !!id.includes("E"):
|
||||
case !!id.includes("L"):
|
||||
case !!id.includes("A"):
|
||||
case !!id.includes("B"):
|
||||
return ["回送", false, false];
|
||||
case !!id.includes("H"):
|
||||
return ["試運転", false, false];
|
||||
}
|
||||
return ["", false, false];
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user