Metamigo frontend build fixes

This commit is contained in:
Darren Clarke 2023-05-25 08:57:24 +00:00
parent 7aeb903a9e
commit de17d54434
3 changed files with 15 additions and 13 deletions

View file

@ -13,11 +13,11 @@ export const sanitizeE164Number = (phoneNumber: string) => {
if (!phoneNumber) return "";
if (!phoneNumber.trim()) return "";
const sanitized = phoneNumber
.replace(/\s/g, "")
.replace(/\./g, "")
.replace(/-/g, "")
.replace(/\(/g, "")
.replace(/\)/g, "");
.replaceAll(/\s/g, "")
.replaceAll(".", "")
.replaceAll("-", "")
.replaceAll("(", "")
.replaceAll(")", "");
if (sanitized[0] !== "+") return `+${sanitized}`;
return sanitized;