# normalizeEmail method

String normalizeEmail([

1. Map<String, Object>? options

])

Canonicalizes an email address. Options include lowercase and specific provider rules.

## Implementation

    String normalizeEmail([Map<String, Object>? options]) {
      Map<String, Object> defaultNormalizeEmailOptions = {'lowercase': true};
      options = options?.merge(defaultNormalizeEmailOptions) ?? defaultNormalizeEmailOptions;
      if (isEmail == false) {
        return '';
      }

      final parts = split('@');
      parts[1] = parts[1].toLowerCase();

      if (options['lowercase'] == true) {
        parts[0] = parts[0].toLowerCase();
      }

      if (parts[1] == 'gmail.com' || parts[1] == 'googlemail.com') {
        if (options['lowercase'] == false) {
          parts[0] = parts[0].toLowerCase();
        }
        parts[0] = parts[0].replaceAll('.', '').split('+')[0];
        parts[1] = 'gmail.com';
      }
      return parts.join('@');
    }