All files / src/validate isMobile.ts

100% Statements 3/3
100% Branches 2/2
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 91x 3x              
export const isMobile = (value: number | string): boolean => {
  return (
    /^((\+86)|(86)|(086))?(1)\d{10}$/.test(String(value)) ||
    /^\+?(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1|)-?\d{1,14}$/.test(
      String(value),
    )
  );
};