sheng-tool
    Preparing search index...

    Function isEmail

    • 验证邮箱格式。

      默认使用宽松模式,覆盖多数业务表单常见输入;严格模式会限制域名必须带两位以上英文顶级域。

      Parameters

      • str: string

        被验证的字符串

      • mode: ValidationMode = 'loose'

        校验模式,默认为 loose

      Returns boolean

      0.0.1

      isEmail('example@hotmail.com')   // true
      isEmail('example@localhost') // false