fix phone number convert (undefined)

This commit is contained in:
kimpure 2026-05-21 15:14:53 +00:00
parent 2ee7f95df6
commit ac279cfbdb
No known key found for this signature in database

View file

@ -205,8 +205,9 @@ export function saferKorean(input: string): string {
// Process number, unit
.replace(/(\+\d+[\s\-]+)?([\d\-]+)/g, (_, prefix: string, phone: string) => {
if (!phone.includes("-")) return prefix + phone;
return PhoneNumberKorean.convert(phone);
const all = prefix + phone;
if (!phone.includes("-")) return all;
return PhoneNumberKorean.convert(all);
})
.replace(/([\d,]+)([kKMmgGtTpP][iI]?)[bB]/g, (_, num: string, mod: string) => {
// 10kib => 십키비바이트