MCPcopy Create free account
hub / github.com/chunshand/qdev / isPhoneNumber

Function isPhoneNumber

admin/src/utils/validate.ts:48–51  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

46
47/** 判断是否为手机号(1 开头) */
48export const isPhoneNumber = (str: string) => {
49 const reg = /^(?:(?:\+|00)86)?1\d{10}$/
50 return reg.test(str)
51}
52
53/** 判断是否为第二代身份证(18 位) */
54export const isChineseIdCard = (str: string) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected