From 4216499e96c76be56bfcb6363410db0a0243ad12 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 10 May 2024 09:29:53 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20WhatsApp=E5=8F=B7=E7=A0=81=E5=A4=84?= =?UTF-8?q?=E7=90=86:=20=E5=88=A0=E9=99=A4=E9=9D=9E=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/channel/whatsappUtils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/channel/whatsappUtils.js b/src/channel/whatsappUtils.js index 4febab3..b450602 100644 --- a/src/channel/whatsappUtils.js +++ b/src/channel/whatsappUtils.js @@ -683,8 +683,8 @@ export const handleNotification = (title, _options) => { * - Phone numbers in Mexico (country code "52") need to have "1" after "+52", even if they're Nextel numbers. */ export const phoneNumberToWAID = (input) => { - // Remove any non-digit characters except '+' - const cleanedInput = (input.replace(/[^\d+]/g, '')) + // Remove any non-digit characters + const cleanedInput = (input.replace(/[^\d]/g, '')) .replace(/^0+/, '') // Remove leading zeros ; @@ -716,8 +716,8 @@ export const phoneNumberToWAID = (input) => { formattedNumber = `52 1 ${formattedNumber.slice(2)}`; } - // Remove any non-digit characters except '+' - formattedNumber = formattedNumber.replace(/[^\d+]/g, ''); + // Remove any non-digit characters + formattedNumber = formattedNumber.replace(/[^\d]/g, ''); return formattedNumber; }