perf: WhatsApp号码处理

dev/timezone
Lei OT 1 year ago
parent 714718053c
commit 375f16486b

@ -682,7 +682,9 @@ export const handleNotification = (title, _options) => {
*/
export const phoneNumberToWAID = (input) => {
// Remove any non-digit characters except '+'
const cleanedInput = input.replace(/[^\d+]/g, '');
const cleanedInput = (input.replace(/[^\d+]/g, ''))
.replace(/^0+/, '') // Remove leading zeros
;
// Check if the number starts with a valid country code
const countryCode = cleanedInput.slice(0, 2);

Loading…
Cancel
Save