mazey
    Preparing search index...

    Variable isMobileConst

    isMobile: (mobile: string) => boolean = isCNMobileNumber

    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 isPhone for that purpose.

    Type Declaration

      • (mobile: string): boolean
      • Check 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
        

        Parameters

        • mobile: string

          The string to check.

        Returns boolean

        Whether the string matches the Chinese mobile-number format.

    Use isCNMobileNumber instead.