normalizeEmail

Normalizes the email address by removing unwanted characters from it. For example [email protected] will become [email protected] and also it will normalize the characters case too.

If value is not a string, it will be returned as it is, otherwise it is passed to validator.js normalizeEmail method.

const sanitizationRules = {
  email: [
    rule('normalize_email')
  ]
}

// pass options
const sanitizationRules = {
  email: [
    rule('normalize_email', {
      all_lowercase: true,
      icloud_remove_subaddress: true
    })
  ]
}

For customized build, you can import this rule as follows.

import { normalizeEmail } from 'indicative/builds/validations'