| 24 | diners: "Diners Club", |
| 25 | discover: "Discover", |
| 26 | jcb: "JCB", |
| 27 | unionpay: "UnionPay", |
| 28 | maestro: "Maestro", |
| 29 | mir: "MIR", |
| 30 | uatp: "UATP", |
| 31 | elo: "Elo", |
| 32 | verve: "Verve", |
| 33 | }; |
| 34 | const k = typeof s === "string" ? s.toLowerCase() : ""; |
| 35 | if (!k) return "N/A"; |
| 36 | return map[k] || (k.charAt(0).toUpperCase() + k.slice(1)); |
| 37 | } |
| 38 | |
| 39 | function normalizeBankName(name: string): string { |
| 40 | if (!name) return "N/A"; |
| 41 | let up = name.toUpperCase(); |
| 42 | // 将 " COMPANY LIMITED" -> ", CO., LTD."," LIMITED" -> ", LTD." |
| 43 | up = up.replace(/\bCOMPANY LIMITED\b/g, "CO., LTD."); |
| 44 | up = up.replace(/\bLIMITED\b/g, "LTD."); |
| 45 | // 在 (TAIWAN)LTD. 中间补逗号 |
| 46 | up = up.replace(/\)(\s*)LTD\./g, "), LTD."); |
| 47 | // 避免重复逗号 |