add phonenumber convert
This commit is contained in:
parent
99ab9428df
commit
2ee7f95df6
1 changed files with 2 additions and 2 deletions
|
|
@ -204,8 +204,8 @@ export function saferKorean(input: string): string {
|
||||||
.replace(/[ㄱ-ㅎㄲㄸㅃㅆㅉ]/g, (char: string) => ChoseongMap[char as keyof typeof ChoseongMap])
|
.replace(/[ㄱ-ㅎㄲㄸㅃㅆㅉ]/g, (char: string) => ChoseongMap[char as keyof typeof ChoseongMap])
|
||||||
|
|
||||||
// Process number, unit
|
// Process number, unit
|
||||||
.replace(/[\d\-]+/g, (phone: string) => {
|
.replace(/(\+\d+[\s\-]+)?([\d\-]+)/g, (_, prefix: string, phone: string) => {
|
||||||
if (!phone.includes("-")) return phone;
|
if (!phone.includes("-")) return prefix + phone;
|
||||||
return PhoneNumberKorean.convert(phone);
|
return PhoneNumberKorean.convert(phone);
|
||||||
})
|
})
|
||||||
.replace(/([\d,]+)([kKMmgGtTpP][iI]?)[bB]/g, (_, num: string, mod: string) => {
|
.replace(/([\d,]+)([kKMmgGtTpP][iI]?)[bB]/g, (_, num: string, mod: string) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue