GeoLeaf Core API - v3.0.0
    Preparing search index...

    Function validateEmail

    • Validates an email address, structurally.

      ⚠️ The check is deliberately shallow — non-empty local part, @, a dotted domain. It accepts addresses that no mail server would, and rejects a few exotic-but-legal ones. It is a typo filter for POI attributes, not a deliverability check.

      Parameters

      Returns { valid: boolean; error: string | null }

      { valid, error }; error is null when valid.

      GeoLeafError A ValidationError when invalid and throwOnError is set.

      // Email valide
      GeoLeaf.Validators.validateEmail("user@example.com");
      // Returns: { valid: true, error: null }

      // Email invalide
      GeoLeaf.Validators.validateEmail("not-an-email");
      // Returns: { valid: false, error: 'Invalid email format' }

      // Formats supportés
      GeoLeaf.Validators.validateEmail("user+tag@sub.example.com"); // valide
      GeoLeaf.Validators.validateEmail("user@domain.co.uk"); // valide