From 19d322a6c8762bb8b380f2764acf7f5c9914fe3b Mon Sep 17 00:00:00 2001 From: glzjin Date: Sun, 28 Apr 2024 09:42:02 +0800 Subject: [PATCH] Fix: Correctly identify Chinese mobile numbers to prevent US mobile numbers from being classified as Chinese mobile numbers. --- packages/connectors/connector-aliyun-sms/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/connectors/connector-aliyun-sms/src/index.ts b/packages/connectors/connector-aliyun-sms/src/index.ts index be32e1ae0..841b71d9e 100644 --- a/packages/connectors/connector-aliyun-sms/src/index.ts +++ b/packages/connectors/connector-aliyun-sms/src/index.ts @@ -20,7 +20,7 @@ import { sendSms } from './single-send-text.js'; import type { Template } from './types.js'; import { aliyunSmsConfigGuard, sendSmsResponseGuard } from './types.js'; -const isChinaNumber = (to: string) => /^(\+86|0086|86)?\d{11}$/.test(to); +const isChinaNumber = (to: string) => /^(\+86|0086|86)\d{11}$/.test(to); const getTemplateCode = ({ templateCode }: Template, to: string) => { if (typeof templateCode === 'string') {