Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/components / src / components / utils / validation.js
Size: Mime:
/**
 * Is validating inputs for the MultiEmailSelect component.
 * We need to allow domains and sub domains starting with a @ here as well
 * @param {String} string
 */
export default function isEmailValidForWhitelist(string) {
  const emailRE = new RegExp(
    /^(.*)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
  );

  return emailRE.test((typeof string === 'string' && string) || '');
}