sheng-tool
    Preparing search index...

    Function isPhone

    • 验证电话号码,规则为可选的区号(3 或 4 位)加横杠,后跟 7 或 8 位数字

      Parameters

      • str: string

      Returns boolean

      0.0.1

      isPhone('010-12345678')  // true