ConstCheck whether a string has the 11-digit Chinese mobile-number format.
The pattern requires a leading 1 followed by ten digits. It does not
verify assigned prefixes, ownership, reachability, or international formats.
Usage:
import { isCNMobileNumber } from "mazey";
const ret1 = isCNMobileNumber("13800138000");
const ret2 = isCNMobileNumber("1380013800");
const ret3 = isCNMobileNumber("138001380000");
const ret4 = isCNMobileNumber("1380013800a");
console.log(ret1, ret2, ret3, ret4);
Output:
true false false false
The string to check.
Whether the string matches the Chinese mobile-number format.
Deprecated alias of isCNMobileNumber.
This helper validates an 11-digit Chinese mobile-shaped number. It does not detect a browser's device form factor; use
isPhonefor that purpose.